- Swagger and postman are used for documentation
- Docker
- docker-compose
- Clone repository:
git clone git@github.com:miguepoloc/django_stack.git
cd django_stack
- Copy
.env.example
to.env
and custom:
cp .env.example .env
- docker-compose
docker-compose -f docker-compose.dev.yml build
docker-compose -f docker-compose.dev.yml up
- Copy
.env.example
to.env
and custom:
cp .env.example .env
- Create virtualenv and activate
python -m venv venv
source venv/bin/activate
(Linux)./venv/Scripts/activate
(Windows)
- Install requirements
pip install -r /requirements.txt
- Run
cd src
python manage.py runserver
docker-compose -f docker-compose.dev.yml run --rm django sh -c "python manage.py makemigrations"
docker-compose -f docker-compose.dev.yml run --rm django sh -c "python manage.py migrate"
cd src
python manage.py makemigrations
python manage.py migrate
docker-compose -f docker-compose.dev.yml run --rm django sh -c "python manage.py startapp appname"
cd src
python manage.py startapp appname
docker-compose -f docker-compose.dev.yml run --rm django sh -c "python manage.py test"
cd src
python manage.py test
docker-compose -f docker-compose.local.yml run --rm django sh -c "coverage run --source=. manage.py test --noinput"
To see the report:
docker-compose -f docker-compose.local.yml run --rm django sh -c "coverage report"
To generate html report:
docker-compose -f docker-compose.local.yml run --rm django sh -c "coverage html"
cd src
coverage run --source=. manage.py test --noinput
To see the report:
coverage report
To generate html report:
coverage html
Use pre-commit to run linter before commit, the command is:
pre-commit run --all-files