- After installing dependecies, use
pip3 freeze > requirements.txtto update the file so others can download the new dependencies.
ifs4205team1
├── adminlogin
│ ├── anonymise.py
│ ├── anonymise_helper.py
│ ├── forms.py
│ ├── static
│ │ └── astyle.css
│ ├── templates
│ ├── urls.py
│ ├── views.py
├── adminusers
│ ├── templates
│ ├── forms.py
│ ├── urls.py
│ ├── views.py
├── core
│ ├── fixtures
│ │ ├── initial_core.json
│ │ ├── initial_users.json
│ │ └── test_users.json
│ ├── management
│ │ ├── commands
│ │ │ ├── clear_users.py
│ │ │ ├── initusers.py
│ │ │ ├── load_csv.py
│ │ │ ├── load_users_csv.py
│ │ └── files
│ │ ├── images.csv
│ │ ├── test_users.csv
│ │ ├── test_users_less.csv
│ │ ├── time_series.csv
│ │ └── videos.csv
│ ├── models.py
├── healthcarelogin
│ ├── templates
│ │ ├── healthcare_change_password_complete.html
│ │ ├── healthcare_change_password.html
│ │ ├── healthcare_dashboard.html
│ │ ├── healthcare_edit_settings.html
│ │ ├── healthcare_login.html
│ │ ├── healthcare_qr.html
│ │ ├── healthcare_settings.html
│ │ └── healthcare_token_register.html
│ ├── urls.py
│ └── views.py
├── healthcarenotes
│ ├── forms.py
│ ├── templates
│ │ ├── create_healthcare_note_for_patient.html
│ │ ├── create_healthcare_note.html
│ │ ├── edit_healthcare_note.html
│ │ ├── edit_healthcare_note_permission.html
│ │ ├── show_all_healthcare_notes.html
│ │ └── show_healthcare_note.html
│ ├── urls.py
│ └── views.py
├── healthcarepatients
│ ├── forms.py
│ ├── templates
│ │ ├── new_patient_images_record.html
│ │ ├── new_patient_readings_record.html
│ │ ├── new_patient_record.html
│ │ ├── new_patient_timeseries_record.html
│ │ ├── new_patient_videos_record.html
│ │ ├── show_all_patients.html
│ │ ├── show_patient.html
│ │ ├── show_patient_record.html
│ │ ├── show_patient_records.html
│ │ └── transfer_patient.html
│ ├── urls.py
│ └── views.py
├── ifs4205team1
│ ├── config
│ │ └── settings
│ │ ├── base.py
│ │ ├── development.py
│ │ ├── production.py
│ │ └── testing.py
│ ├── templates
│ │ └── protected_record.html
│ ├── urls.py
│ ├── views.py
│ └── wsgi.py
├── manage.py
├── media
│ ├── images
│ ├── timeseries
│ └── videos
├── mobileregister
│ ├── forms.py
│ ├── templates
│ │ ├── repeat_register.html
│ │ ├── success_register.html
│ │ ├── user_login.html
│ │ └── user_register.html
│ ├── urls.py
│ └── views.py
├── patienthealthcare
│ ├── fixtures
│ │ └── initial_notes.json
│ ├── management
│ │ └── commands
│ │ └── initnotes.py
│ ├── templates
│ │ ├── show_all_notes.html
│ │ └── show_note.html
│ ├── urls.py
│ └── views.py
├── patientlogin
│ ├── forms.py
│ ├── templates
│ │ ├── patient_change_password_complete.html
│ │ ├── patient_change_password.html
│ │ ├── patient_dashboard.html
│ │ ├── patient_edit_settings.html
│ │ ├── patient_login.html
│ │ ├── patient_qr.html
│ │ ├── patient_settings.html
│ │ └── patient_token_register.html
│ ├── urls.py
│ └── views.py
├── patientrecords
│ ├── fixtures
│ │ ├── initial_data_readings.json
│ │ ├── initial_data_readingsperm.tar.xz
│ │ └── initial_records.json
│ ├── forms.py
│ ├── management
│ │ ├── commands
│ │ │ ├── clear_records.py
│ │ │ ├── generate_records.py
│ │ │ ├── initrecords.py
│ │ └── files
│ │ ├── diagnosis_random.csv
│ │ ├── diagnosis_random_less.csv
│ │ ├── readings.csv
│ │ └── readings_less.csv
│ ├── models.py
│ ├── templates
│ │ ├── edit_permission.html
│ │ ├── new_documents_record.html
│ │ ├── new_images_record.html
│ │ ├── new_readings_record.html
│ │ ├── new_record.html
│ │ ├── new_timeseries_record.html
│ │ ├── new_videos_record.html
│ │ ├── show_all_records.html
│ │ └── show_record.html
│ ├── templatetags
│ │ ├── app_filters.py
│ ├── tests
│ │ └── test_views.py
│ ├── urls.py
│ └── views.py
├── requirements.txt
├── researcherlogin
│ ├── forms.py
│ ├── templates
│ │ ├── researcher_change_password_complete.html
│ │ ├── researcher_change_password.html
│ │ ├── researcher_dashboard.html
│ │ ├── researcher_edit_settings.html
│ │ ├── researcher_login.html
│ │ ├── researcher_qr.html
│ │ ├── researcher_settings.html
│ │ └── researcher_token_register.html
│ ├── urls.py
│ └── views.py
├── researcherquery
│ ├── fixtures
│ │ └── initial_saferecords.json
│ ├── forms.py
│ ├── management
│ │ └── commands
│ │ ├── init_saferecords.py
│ ├── models.py
│ ├── router.py
│ ├── static
│ │ └── researcherstyle.css
│ ├── templates
│ │ └── search_records.html
│ ├── templatetags
│ │ ├── app_filters.py
│ ├── urls.py
│ └── views.py
├── templates
│ ├── admin_base.html
│ ├── base.html
│ ├── healthcare_base.html
│ ├── home.html
│ ├── patient_base.html
│ └── researcher_base.html
└── userlogs
├── models.py
├── router.py
commandsinitusers: Loadsinital_users.jsonfixture into databaseload_csv: Loads a csv file (test_user.csv) into database
models.py:User(extended fromdjango.contrib.auth.models.AbstractUser,Patient,Healthcare,Researcher,Admin
views.py: Patients' Login, Settings -related views
commandsinitrecords: Loadsinitial_records.jsonfixture into database
models.py:Readings,TimeSeries,Documents,Images,Videos,ReadingsPerm,TimeSeriesPerm,DocumentsPerm,ImagesPerm,VideosPerm,Diagnosis,DiagnosisPermviews.py: Patients' Medical Records, Medical Records' Permissions -related views
views.py: Patients' Healthcare Professional Notes -related views
views.py: Healthcare Professionals' Login, Settings -related views
commandsinitnotes: Loadsinitial_notes.jsonfixture into database
views.py: Healthcare Professionals' Patients -related views
views.py: Researchers' Login, Settings -related views
models.py:QiInfo,SafeUsers,SafeDiagnosis,SafeReadings,SafeImages,SafeVideosviews.py: Researchers' Query, Download Anonymised Records -related views
-
Install the virtual environment, and
virtualenvwrapperto manage the virtual environments~$ pip3 install virtualenv ~$ pip3 install virtualenvwrapper -
Create a file to store all virtual environments in the same place
~$ mkdir ~/.virtualenvs -
Add the following at the end of the
.bashrcfile:VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3 export VIRTUALENVWRAPPER_PYTHON export WORKON_HOME=$HOME/.virtualenvs source /usr/local/bin/virtualenvwrapper.shIf paths above are incorrect, use
which python3andwhich virtualenvwrapper.shto find the correct paths. -
Reload
.bashrcfile~$ source ~/.bashrc -
Navigate to the Django project, and create a new virtual environment
~$ mkvirtualenv --python=/usr/local/bin/python3 ifsteam4205env -
Install dependencies
~$ pip3 install -r requirements.txt
The database used is PostgreSQL v10.10.
-
Create a
.envfile in theifs4205team1/config/settingsfolder. -
Add the following into the
.envfile:export DB_NAME = 'YOUR_DB_NAME' export DB_USER = 'YOUR_DB_USER' export DB_PASS = 'YOUR_DB_PASS' export DB_HOST = 'localhost' -
Make migrations
~$ python manage.py makemigrations ~$ python manage.py migrate
-
Run the following commands
$ python manage.py initusers $ python manage.py initrecords $ python manage.py initnotes
- Run the following commands
$ python manage.py load_csv --csvpath="<PATH/TO/CSV>/ifs4205team1/core/management/files/test_users.csv"
Note: A test_users_less.csv with only a few rows of data exists in the same directory for testing purposes.
-
Add on the following into the
.envfile:export MEDIA_URL = 'MEDIA_URL'
-
Start Django
~$ python manage.py runserver
-
Start the virtual environment before working on the project
~$ workon ifs4205team1env