My personal (very) opinionated django template
What is in the box
- API-only django (checkout this post in Russian) based on Django REST Framework with JWT support
- pip-tools with separate development-time dependencies
- Strict type checking with mypy, django-stubs and djangorestframework-stubs
- flake8 with ton of plugins (contact me if you know more)
- black as uncompromising code formatter
- Starter CI configuration on GitHub Actions
- pytest with useful stuff like freezegun, pytest-mock and super convinient DRF test client
- Custom user model
- drf-spectacular for API Schema generation
- django-axes for additional security
- Whitenoise for effortless static files hosting
- cloudflare-ready with django-ipware
- Sentry. Set
SENTRY_DSN
env var if you need it. - Postgres ready. Set
DATABASE_URL
env var to something likeDATABASE_URL=postgres://postgres@localhost:5432/postgres
Optional next steps
You definetely should consider this steps after installation:
- Install pytest-xdist if you plan to grow beyond 500 unittests
- If you are into docker, check out this docker-compose.yml to run on your machine
Installation
$ pip install --upgrade cookiecutter
$ cookiecutter gh:fandsdev/django
FAQ
I have got an error «'random_ascii_string' is undefined»
You should upgrade cookiecutter to the latest version: pip install --upgrade cookiecutter
I wanna hack this!
Thank you so much! Check out our build pipeline and pick any free issue.