Development Environment Setup
- Install Python 3.8 (Or create a Python environment with specific version such as using Conda:
conda create -n myenv python=3.8 && conda activate myenv
) - Install Git LFS (https://git-lfs.github.com)
- Clone/fork this repo
Set up environment using the env_setup.sh script provided
- Set up environment:
source env_setup.sh
This will set up a Python environment under theenvironment/
folder, as well as creatingactivate.sh
which can be used for setting the environment variables. - Edit the environment variables in
activate.sh
. This file is in .gitignore and won't up updated to the repo. You can create a random secret key for Django using:from django.core.management.utils import get_random_secret_key print(get_random_secret_key())
- Activate the environment:
source activate.sh
. Alternatively, to activate the environment without loading environment variables from activate.sh (ie. using default development configurations), runsource environment/bin/activate
instead.
Set up environment not using the env_setup.sh script provided
- With a Python 3.8 environment activated, install the dependencies described in requirements.txt, you can do so using pip:
pip install -r requirements.txt
- Set up environment variables (optional, you can skip this step if you are using default development configurations)
Default development configurations
A set of default development configurations will be used unless otherwise specified as environment variables. The default configurations are as the following:
-
- DJANGO_SECRET_KEY: ...
-
- RDS_DB_NAME: "icd_recommender"
-
- RDS_USERNAME: "postgres"
-
- RDS_PASSWORD: ""
-
- RDS_HOSTNAME: "127.0.0.1"
-
- RDS_PORT: "5432"
-
- FRONT_END_BASE_URL: "http://localhost:3000"
-
- FRONT_END_OAUTH_CLIENT_ID: ...
-
- DJANGO_EMAIL_USERNAME: ""
-
- DJANGO_EMAIL_PASSWORD: ""
You can overwrite these default values by setting them as environment variables, such as editing the activate.sh
generated by the env_setup.sh
provided.
Typical first time set-up commands
- python manage.py migrate
- python manage.py initialize
- python manage.py createsuperuser
- python manage.py runserver