- Python 3.7.5
- You will need a secret .env file to access keys and tokens.
- PostgreSQL
You will need a secret .env file to access keys and tokens.
python3 -m venv env
to generate a virtual environment for the projectsource env/bin/activate
to activate virtual environment- Inside virtual env:
pip install -r requirements.txt
to install all necessary packages - Make sure you have a postgres database created that matches the one in .env
- Make sure .env variable PROD is set to False
Helpfull commands (PosgreSQL_GetStarted):
sudo -u postgres -i
dropdb [DB NAME]
createdb [DB NAME]
psql
(to activate interactive PostgreSQL client as user postgres if previous command)- \l (list db)
psql databasename < data_base_dump
- Apply migrations
python manage.py makemigrations
- Apply dump
- Run
python manage.py runserver
- Make sure .env variable PROD is set to True and .env DB_NAME is correctly set to db service
- Run
docker-compose build
- Run
docker-compose up
- If you need to create a superuser, befor step 3:
- Run
docker-compose run --rm --entrypoint bash bianca_web
this will create a container where you will have access to runpython manage.py createsuperuser
and this will be stored in the postgres db. - After this run step 3:
docker-compose up
- Run
- When finished:
docker-compose down
Docker cheat sheet might help