A Cookiecutter template for creating production-ready Django REST Framework projects quickly.
- For Django 5.2
- Works with Python 3.11, 3.12, and 3.13
- Optimized for API development with Django REST Framework
- Modern project structure with apps directory for better organization
- Secure by default with JWT authentication
- Custom user model ready to go
- Comprehensive soft delete implementation
- API documentation with drf-spectacular (Swagger/OpenAPI)
- Robust logging with Loguru
- Default integration with pre-commit for code quality
- Ruff for linting and formatting
First, make sure you have Cookiecutter installed:
pip install cookiecutterThen generate a new DRF project:
cookiecutter https://github.com/jingran-dev/drf-cookiecutterYou'll be prompted for some values. Provide them, and then a Django REST Framework project will be created for you.
project_name: Your project's human-readable nameproject_slug: Your project's slug (used for directories and files)description: A brief description of the projectauthor_name: Your name or your organization's nameemail: Your email or your organization's contact emailusername_type: Choose between username or email for authenticationopen_source_license: Choose your preferred licensepython_version: Choose Python version (3.11, 3.12, or 3.13)
To contribute to this cookiecutter template:
- Fork this repository
- Create a new branch for your changes
- Make your changes
- Run the tests with
tox - Submit a pull request
This project includes a test suite to ensure the template works correctly:
# Run all tests
tox
# Run specific test environments
tox -e py313
tox -e ruffMIT