- Create a virtual environment:
virtualenv -p python3.8.2 venv - Activate the virtual environment:
source venv/bin/activate - Install requirements:
pip install -r requirements.txt - Create postgres user:
createuser -d -P <username> - Create postgrest database:
createdb -O <username> <dbname> - Create .env file with environment variables (secret key, db creds, etc.)
- Load environment variables:
source .env - Apply database migrations:
python manage.py migrate - Create a local superuser:
python manage.py createsuperuser
- Activate the virtual environment:
source .env - Start django server:
python manage.py runserver
- Import script into run.py
- Run the code in run.py in the python shell:
python manage.py shell < run.py