Key features
- ๐งช 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. Start with the email as the unique identifier.
- ๐๏ธ A custom BaseModel to easily add
created_at
and updated_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.
- ๐งฉ Django Extensions for custom management commands and model enhancements.
- ๐ง Get out of the box code formatting with Black, linting with Flake8 and test with Pytest.
- ๐จโ๐ป Develop with VS Code and Dev Containers.
Requirements
- ๐ป VS Code
- ๐ Docker
- ๐ณ Docker Compose
How to use
- 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 select Reopen in container
. This will:
- Create a dev container.
- Setup a Redis server.
- Setup your PostgreSQL database.
- Install the dependencies.
- Migrate the database.
- Create your super user with
python manage.py createsuperuser
.
- Run the project with
python manage.py reserver
.
- Work as usual.
Commands
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.
You can also use:
-
poetry run server
instead of python manage.py runserver
-
poetry run makemigrations
instead of python manage.py makemigrations
-
poetry run migrate
instead of python manage.py migrate
Todo