5. Cookiecutter-Django
Date: 2024-03-12
Status
Accepted
Context
After we have decided to use Django in ADR 0004, we need to think about the project setup. This includes the different settings or the use of third-party frameworks.
We were influenced by the book “Two Scoops of Django” (Best practices for the Django web framework). The authors of the book also implemented Cookiecutter-Django (https://github.com/pydanny/cookiecutter-django), following their best practices layed out in “Two Scoops”.
Django also has the command startproject to establish a projects structure. The generated project structure of startproject is much simpler than the Cookiecutter-Django setup but hurts some security guidelines and best practices (like the 12-factor-app )and is less documented.
Decision
We use the Cookiecutter-Django to initialise our project. We used the instructions and the code from https://cookiecutter-django.readthedocs.io/en/latest/. We remove unused things.
Consequences
We need to remove all unneeded additional code from Cookiecutter-Django.
In general, the consequences are little because we can manually change all files generated by Cookiecutter-Django. We do not depend on further developement of Cookiecutter-Django.
We follow loosely the way of doing described in “Two Scoops of Django”.