Skip to main content

A cookiecutter template for creating Django packages.

Project description

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
image

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.toml configured 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cookiecutter_django_package-0.1.0.tar.gz (71.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cookiecutter_django_package-0.1.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file cookiecutter_django_package-0.1.0.tar.gz.

File metadata

File hashes

Hashes for cookiecutter_django_package-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5a8a95066d5960a96b5bbdf23b60a74e39faabee0d58a88d049067f7383aee93
MD5 7aff2003e4bd979e13adae6afd476154
BLAKE2b-256 c860a26c933b05eba2a41732a953f38144c655c9343d9f3c658606501312cb5f

See more details on using hashes here.

File details

Details for the file cookiecutter_django_package-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cookiecutter_django_package-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63c00b8ef939f92c365984558cfe3987e78e41630d6ee8c1c8176c4d479085e8
MD5 b683da866fbda70849d400e7af7a9a3f
BLAKE2b-256 cf44cca73a791d34030e9e2a775fd1b1e0479a54f3fbda7bb58af12f3ec14c4c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page