diff --git a/README.md b/README.md index 85cec16..1c8ade7 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ cookiecutter https://github.com/singularit-de/cc-python.git --directory django --checkout v1.1.0 ``` +For Django projects, see the [Django README](django/README.md) for details on the template and the questions you’ll be asked during project creation. ## Why we are using templates Cookiecutter templates ensure consistency, standardization, and best practices across all Python projects at singularIT. They: diff --git a/django/README.md b/django/README.md new file mode 100644 index 0000000..9d6e774 --- /dev/null +++ b/django/README.md @@ -0,0 +1,50 @@ +# Cookiecutter Django + +## Features + +- Django 6 +- Python 3.14, 3.13, 3.12 +- PostgreSQL 18, 17, 16 +- Package and Project management with uv +- Pre-commit hooks for code quality and formatting + - ruff +- Optional DRF (Django Rest Framework) setup +- GitLab CI/CD + - pre-commit checks + - django tests + - deployment checks + - automated deployment to our staging environment +- Dependency Tracking +- Custom `User` model +- ``common`` directory with utility functions and classes + +## `cookiecutter.json` questions + +1. `project_name` - Human-readable project name + - Used in the README and API documentation. + +2. `project_slug` - Project identifier / Python package name (slugified) + - Used throughout the codebase, e.g. in `import` statements, as the Django project/module name, and in the GitLab + CI/CD configuration. + - Use a valid Python module name (typically lowercase letters, numbers, and underscores; must not start with a + number). + +3. `customer` - Customer/client name (optional) + - Used in the README. + +4. `python_version` - Python version for the project + - Prefer the latest stable Python version that is supported by Django and your dependencies. + +5. `postgresql_version` - PostgreSQL version for the project + - Prefer the latest stable PostgreSQL version. + +6. `username_type` - Identifier used to log in (for the Django user model) + - Commonly set to `email` for customer projects. (This affects the custom user model and should be chosen early.) + +7. `use_drf` - Include Django REST Framework (DRF) + - If set to `yes`, DRF, drf-spectacular, django-filter, and django-cors-headers will be installed and preconfigured. + +## ``common`` directory + +The ``common`` directory contains basic utility functions for models, Django management commands, tests. If DRF is +enabled, it also contains filters, a BinaryRenderer and a MultipleSerializersMixin for ViewSets. \ No newline at end of file diff --git a/django/{{ cookiecutter.project_slug }}/README.md b/django/{{ cookiecutter.project_slug }}/README.md index 5acff68..ff0cf67 100644 --- a/django/{{ cookiecutter.project_slug }}/README.md +++ b/django/{{ cookiecutter.project_slug }}/README.md @@ -59,6 +59,8 @@ git push --set-upstream origin main ``` +7. Add our [Renovate Dog](https://singular-code.de/renovate.dog) to the GitLab repository and follow the instructions in the [BetterWiki article](https://singularit.singular-pages.de/better-wiki/wiki/tools/renovate-bot/#wie-kann-ich-den-renovate-bot-benutzen). + **------------------- END DELETE SECTION --------------------** ## Get started locally