A Cookiecutter template for creating Django projects with Celery, Celery Beat, Django Ninja for APIs, and Docker support.
- Django {{ django_version | default('5.0') }}: The core web framework.
- Django Ninja: Fast, async-ready API framework with type hints.
- Celery & Celery Beat: Asynchronous task processing and periodic tasks.
- PostgreSQL: Default database.
- Redis: Default Celery broker and result backend.
- Docker & Docker Compose: For containerized development and deployment setup.
- Environment Variables: Settings managed via
.envfile usingpython-decouple. - Basic Settings Structure: Separate settings for
localandproduction. - Gunicorn: Production WSGI server.
- Whitenoise: Simplified static file serving for production (optional).
- Coding Agents: Optional configs for Claude Code, Gemini CLI, OpenCode, Pi, and Copilot via
coding_agents(sharedAGENTS.md).
- Python 3.8+
- Cookiecutter:
pip install cookiecutter - Docker & Docker Compose (if using the Docker setup
use_docker=y)
Generate your project using Cookiecutter:
cookiecutter gh:your-github-username/cookiecutter-django-celery-ninjaOr from a local clone:
cookiecutter /path/to/cookiecutter-django-celery-ninjaYou will be prompted for configuration values (like project name, author, database settings, etc.). See cookiecutter.json for details.
The template can generate configuration for multiple AI coding agents:
# All agents (default)
cookiecutter gh:your-github-username/cookiecutter-django-celery-ninja --no-input coding_agents=all
# Select specific agents (comma-separated)
cookiecutter gh:your-github-username/cookiecutter-django-celery-ninja --no-input coding_agents="claude,gemini,opencode"
# No agent configs
cookiecutter gh:your-github-username/cookiecutter-django-celery-ninja --no-input coding_agents=noneSupported: claude (→ CLAUDE.md + .claude/), gemini (→ GEMINI.md + .gemini/settings.json), opencode (→ opencode.json + AGENTS.md), pi (→ AGENTS.md + .pi/settings.json), copilot (→ .github/copilot-instructions.md). AGENTS.md is the canonical single source of truth; CLAUDE.md/GEMINI.md are thin @AGENTS.md bridges.
This template includes comprehensive testing using tox to ensure all functionality works correctly.
Install test dependencies:
pip install -r test-requirements.txtRun all tests across multiple Python versions:
# Run basic validation
tox -e validate
# Run quick tests
tox -e quick-test
# Run template tests
tox -e template-test
# Run all validation tests
tox -e all-tests
# Run tests for specific Python version
tox -e py311
# Run all environments
tox# Traditional test methods
make test # Run all tests
make test-basic # Basic validation only
make test-gen # Test cookiecutter generation
make test-full # Full test suite
# Tox-based tests
make tox-test # Run tox tests
make tox-validate # Run tox validation
make tox-all # Run all tox environments# Individual test scripts
python validate_template.py # Comprehensive validation
python tests/quick_test.py # Quick validation
python tests/run_tests.py # Full test suite
python -m pytest tests/test_cookiecutter.py -v # Pytest testsvalidate: Template structure validationquick-test: Quick validation checkstemplate-test: Full template testingpy38,py39,py310,py311,py312: Python version-specific testslint: Code linting with flake8, black, isortformat: Code formatting with black and isortcoverage: Test coverage reportingall-tests: Comprehensive test suite
After generating the project, navigate to the project directory (cd your_project_slug) and follow the instructions in the generated project's README.md.
Contributions are welcome! Please feel free to submit a pull request or open an issue.