Django project template based on cookiecutter.
- Settings via environment variables with django-environ.
- Celery configuration.
- Django REST Framework configuration + Swagger with drf-yasg.
- Typical user CRUD APIs.
- Routine tasks configuration with fabric & invoke.
- Simple docker-compose configuration for local development (incl. Postgres, Redis & MailHog for testing emails).
- Requirements management with pip-tools.
- pytest configuration.
- Code formatting with Black.
- Imports sorting with isort.
- Checking code with bandit, mccabe, pycodestyle, pyflakes, pylint and radon.
- Pre-commit hook for running test & linters on each commit.
- CircleCI configuration for running tests & linters on each pull request.
- Integration with Sentry.
Create python virtual environment. We recommend to use pyenv & pyenv-virtualenv:
pyenv install 3.9.5
pyenv virtualenv 3.9.5 my_project
pyenv activate my_project
Install cookiecutter and packaging:
pip install cookiecutter packaging
Step into directory you want to create project and generate project with cookiecutter:
cd /path/to/directory
cookiecutter https://github.com/django-stars/backend-skeleton
Answer the questions in wizard.
Install tools required to build a dependencies list:
pip install -U fabric invoke pip pip-tools
Compile dependencies list:
fab pip.compile
Install dependencies:
fab pip.sync
Run backing services:
fab compose.up -d
Copy .env
file from example file and set your settings:
cp ./api/.env.example ./api/.env
Run migrations:
./api/manage.py migrate
Start building your awesome project!