Django Package Cookiecutter Template
Cookiecutter template for creating reusable Django packages with production-ready structure.
Prerequisites
Make sure to have the following on your host:
- uv
- Cookiecutter:
pip install cookiecutter
Quickstart
Generate a new Django package:
uv tool install cookiecutter
cookiecutter gh:TheAbhijeet/cookiecutter-django-package
Configuration Options
| Prompt | Default | Description |
|---|---|---|
project_name |
my-django-package |
Full name of your package (kebab-case recommended) |
package_name |
Auto-generated | Python importable name (auto-converted from project_name) |
example_project_name |
example_project |
Name of the example_project Django project for testing |
author_name |
Your Name |
Your name for package metadata |
author_email |
your.email@example.com |
Your email for package metadata |
version |
0.1.0 |
Initial package version (semantic versioning) |
description |
A reusable Django application. |
Short description for PyPI |
license |
MIT |
Choose license: MIT, BSD, ISC, Apache-2.0, or GPL-3.0 |
python_env |
uv |
Package manager: uv (fast) or Poetry |
include_drf |
False |
Include Django REST Framework serializers and viewsets |
include_celery |
False |
Include Celery configuration for async tasks |
include_admin_templates |
False |
Include custom Django admin templates |
include_templates |
False |
Include templates/static folders for frontend assets |
Set up the generated project:
cd <project_slug>
uv sync
uv run python example_project/manage.py migrate
uv run python example_project/manage.py runserver
Features
- src/ Layout - Prevents accidental imports from project root
- Demo Project - Ready-to-run Django project for testing
- PyPI Ready -
pyproject.tomlconfigured for building - CI/CD - GitHub Actions workflow included
- Testing - pytest with Django integration
- Documentation - Sphinx-ready docs folder
Template Structure
cookiecutter-django-package/
├── cookiecutter.json
├── extensions.py
├── hooks/
├── {{cookiecutter.project_name}}/
│ ├── src/
│ ├── tests/
│ ├── example_project/
│ ├── docs/
│ └── pyproject.toml
├── tests/
└── pyproject.toml
Development (Template)
Clone and set up the template itself:
git clone https://github.com/TheAbhijeet/cookiecutter-django-package.git
cd cookiecutter-django-package
uv sync
Run template tests:
uv run pytest
License
MIT
Metadata
Release files for cookiecutter-django-package 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cookiecutter_django_package-0.1.0.tar.gz | 71.5 kB | Without provenance | Details for cookiecutter_django_package-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cookiecutter_django_package-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for cookiecutter_django_package-0.1.0-py3-none-any.whl |
Total release size: 74.4 kB
Security for cookiecutter-django-package 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.