A comprehensive and easy-to-use starting point for your new API with Django and DRF.
- 🧪 Fully tested with Pytest.
- 🚀 Enjoy the latest version of Django (5+) with all its features and improvements.
- 🌐 Django Rest Framework for building APIs.
- ⛃ Start your project with PostgreSQL without the need to install and configure it.
- 📦 Redis caching out of the box.
- 🔒 Login, Logout, Logout all, User profile and creation with Knox, an easy-to-use authentication for DRF.
- 👤 Extended user model and a custom manager with the email as the unique identifier. Define your own fields and behaviors specific to your application's requirements.
- 🔢 A custom BaseModel to easily add
created_at
andupdated_at
fields to your models. - 🔢 A custom SoftDeleteBaseModel to add soft delete functionality to the models you choose to.
- 🕒 Fully configured asynchronous tasks with Celery. It also includes a reusable BaseTaskWithRetry.
- 🕑 django_celery_results enables Celery to store task results using Django's database backend.
- 📅 django_celery_beat for periodic task scheduling using the Django admin interface.
- 🌪️ django-filter add support for complex filtering of querysets in Django and DRF views.
- Test your queries and code interactively with Jupyter Notebooks.
- 🐞 Django Debug Toolbar for debugging and profiling and Django Extensions for custom management commands and model enhancements.
- 👨💻 Develop with VS Code and Dev Containers. Get out of the box code formatting with Black, linting with Flake8 and test with Pytest.
- </> VS Code
- 🐋 Docker
- 🐳 Docker Compose
- Clone the repo or use it as a template to start a new project.
- Open the project in VS Code.
- If you installed the recommended extensions, open
Todo Tree
in the sidebar. It will guide you trough the first steps setting up your project, like changing the name of the container, adjusting your URLS, etc. - Use
env.example
to create a.env
file. - Hit
CTL/CMD + Shift + p
and selectReopen in container
. This will:- Create a dev container.
- Install the dependencies.
- Setup your PostgreSQL database.
- Setup a Redis server.
- Migrate the database.
- Create your super user with
python manage.py createsuperuser
. - Run the project with
python manage.py reserver
. - Work as usual.
This template comes with some shortcuts so you don't have to memorize how to start the workers:
poetry run worker
: to start a new Celery worker.poetry run beat
: to start your periodic tasks.
And if you feel like it, you can also use:
poetry run server
instead ofpython manage.py runserver
poetry run makemigrations
instead ofpython manage.py makemigrations
poetry run migrate
instead ofpython manage.py migrate
- Index Page with a link to the Django admin
- Data seeding
- API Versioning
- OpenAPI 3 schema auto generation and Swagger
- Production Docker file
- Production Docker compose file
- CI/CD with Github Actions