Skip to content

Latest commit

 

History

History
60 lines (37 loc) · 1.79 KB

README.md

File metadata and controls

60 lines (37 loc) · 1.79 KB

Arboverse

Arboviruses geographic info

Quick setup

Running for the First Time

  1. Clone this project
  2. Install Docker and Docker Compose
  3. Once in its root, run docker-compose build
  4. Start the database with docker-compose up -d db
  5. Then docker-compose run --rm web sh -c 'python manage.py sqlcreate && python manage.py migrate'
  6. And finally docker-compose up -d. Every other time, this is all you'll need.

Running every other time

When you're working, just run docker-compose up -d. The system will be available at http://127.0.0.1:8000

This will run the project in the background. To stop, do docker-compose down.

If you do not want to run it in the background, ommit the -d flag, docker-compose up

Seeing the Logs

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.

Using the Shell

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

Running Tests

docker-compose run --rm web pytest

Developing Locally

  1. Create a virtual environment python -m venv env
  2. Activate it source env/bin/activate
  3. Install the requirements with pip install -r requirements/local.txt

Setup pre-commit

  1. Install pre-commit
  2. Run pre-commit install -t pre-commit -t pre-push
  3. Optional: you may run all hooks with pre-commit run --all

Prod Setup

  1. Copy sample.env to .env -> cp sample.env .env