ArboverseArboviruses geographic infoQuick setup Note: when running commands in docker, your .env needs to have the PGSQL host as db. When running code from the terminal here, you need the .env to reflect the host as localhost.Running for the First TimeClone this project Install Docker and Docker Compose Navigate to the project root. Populate the values of .env.sample to match…
Source code on GitHub.
Arboviruses geographic info
.env.sample to match your desired configuration, and remove .sample from the filename. docker-compose up --build -d.pip install -r requirementsrequirements.txtpython manage.py makemigrationspython manage.py migratepy schema_populator.py once you have verified that the db is running to build out the full database.If you do not follow steps 5 through 8 in this order, you will encounter issues with not all the tables being available in the database. This will require manually dropping the tables, and making a new migration so that all data models are correctly tracked.
With that, your application should be running. You may access it at http://localhost:8000. As long as docker continues to run, this service will run in the background. When docker is restarted, the service too should be restarted automatically. If not, you can rerun the command.
Note: It may take a minute or two for the site to be accessible. A health check is performed on the database to ensure that the containers load in the correct order.
docker-compose run --rm web python manage.py createsuperuser and follow the prompts.Got stuck somewhere? You can see the logs with docker-compose logs.
If you're only interested in Django's logs, run docker-compose logs web.
If you're only interested in database's logs, run docker-compose logs db.
Our Django setup comes with a very handy super shell. It is useful to interact with our code in a REPL shell.
Run it with docker-compose run --rm web python manage.py shell_plus
docker-compose run --rm web pytest
python -m venv envsource env/bin/activatepip install -r requirements/requirements.txt