Skip to main content

django-structurator is an incredibly powerful, AI-friendly CLI tool designed to scaffold production-ready Django projects and apps instantly. It enforces a strict, scalable architecture out of the box, eliminating repetitive boilerplate and creating a highly modular environment.

Project description

django-structurator

๐Ÿš€ django-structurator is an incredibly powerful, AI-friendly CLI tool designed to scaffold production-ready Django projects and apps instantly. It enforces a strict, scalable architecture out of the box, eliminating repetitive boilerplate and creating a highly modular environment.

Whether you're a human developer looking for consistency or an AI Coding Assistant (like Cursor, Claude, or Antigravity) seeking explicit structural rules, this package lays down a flawless foundation. No extra dependencies. No bloated templates. Just a clean, prompt-driven workflow.


โš™๏ธ Features

  • ๐Ÿ“ Scalable Folder Structure โ€“ Consistent architecture for better maintainability.
  • ๐Ÿงฉ Modular App Generation โ€“ Create Django apps with optional files: forms, signals, validators, tasks, and more.
  • ๐Ÿ”Œ Optional Add-ons:
    • Django REST Framework (DRF)
    • Django Debug Toolbar
    • Celery + Redis
    • SMTP Email Configuration
    • Jazzmin Admin UI
    • Custom Django Logger
  • ๐Ÿ“„ Auto-generates essentials: .env.example, .gitignore, requirements/, and more.

๐Ÿ“ฆ Installation

pip install django-structurator

โšก Usage

๐Ÿ“‚ Create a New Django Project

Interactive Mode:

django-str startproject

Non-Interactive Mode (Full Stack Automation):

django-str startproject --no-que --name myproject --path . --env django-environ --db postgresql --use-docker --use-celery

The CLI natively supports configuring:

  • Database: SQLite / PostgreSQL / MySQL
  • Environments: django-environ / python-dotenv
  • Optional Integrations: use-smtp-email, use-celery, use-redis, use-drf, use-jazzmin, use-logger, use-docker

๐Ÿงฑ Create a New Django App

App generation must be executed from the root of an existing Django project (where manage.py lives).

Interactive Mode:

django-str startapp

Non-Interactive Mode (API Microservice):

django-str startapp --no-que --name billing --use-api-drf --use-tasks

Optional App-level Modules:

  • use-forms, use-signals, use-tasks, use-app-static-template, use-template-tags, use-api-drf

๐Ÿ—๏ธ Example Project Structure

```text
my_project/
โ”‚
โ”œโ”€โ”€ docs/                     # Documentation files
โ”‚   โ”œโ”€โ”€ ARCHITECTURE.md       # Project folder architecture guide
โ”‚   โ”œโ”€โ”€ CHANGELOG.md          # Change log for the project
โ”‚   โ””โ”€โ”€ README.md             # Main documentation file
โ”‚
โ”œโ”€โ”€ local_db/                 # Local SQLite database for development
โ”‚   โ””โ”€โ”€ db.sqlite3
โ”‚
โ”œโ”€โ”€ logs/                     # Every level Log files will be here
โ”‚   โ”œโ”€โ”€ critical.log
โ”‚   โ”œโ”€โ”€ debug.log
โ”‚   โ”œโ”€โ”€ error.log
โ”‚   โ”œโ”€โ”€ info.log
โ”‚   โ””โ”€โ”€ warning.log
โ”‚
โ”œโ”€โ”€ nginx/                    # Optional: Nginx reverse proxy configuration
โ”‚   โ””โ”€โ”€ nginx.conf
โ”‚
โ”œโ”€โ”€ docker-compose.yml        # Optional: Docker map (web, db, redis, celery)
โ”œโ”€โ”€ Dockerfile                # Optional: Docker web container configuration
โ”‚
โ”œโ”€โ”€ requirements/             # Dependency management
โ”‚   โ”œโ”€โ”€ base.txt              # Core dependencies
โ”‚   โ”œโ”€โ”€ development.txt       # Development-specific dependencies
โ”‚   โ”œโ”€โ”€ production.txt        # Production-specific dependencies
โ”‚   โ””โ”€โ”€ test.txt              # Testing dependencies
โ”‚
โ”œโ”€โ”€ src/                      # Main source code folder
โ”‚   โ”œโ”€โ”€ apps/                 # All Django apps
โ”‚   โ”‚   โ”œโ”€โ”€ app-1/            # Example Django app
โ”‚   โ”‚   โ”‚   โ”‚
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ api/          # API for app-1
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ v1/       # Version 1 of the API
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ serializers.py
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ urls.py
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ views.py
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ __init__.py
โ”‚   โ”‚   โ”‚   โ”‚
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ migrations/   # Database migrations
โ”‚   โ”‚   โ”‚   โ”‚
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ templatetags/ # Custom template tags and filters
โ”‚   โ”‚   โ”‚   โ”‚
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ admin.py      # Admin site configuration
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ apps.py       # App configuration
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ models.py     # App models (Abstracts TimeStamped UUID)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ tests.py      # Isolated DB test cases
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ urls.py       # App-specific URL patterns
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ views.py      # App views
โ”‚   โ”‚   โ”‚
โ”‚   โ”‚   โ”œโ”€โ”€ app-2/            # Another app
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ common/               # Shared utilities, constants, and helpers
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ constants.py      # Commonly used constants
โ”‚   โ”‚   โ””โ”€โ”€ helpers.py        # Utility functions (mailer, loggers)
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ config/               # Project configuration
โ”‚   โ”‚   โ”œโ”€โ”€ settings/         # Environment-specific settings
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ base.py       # Base settings
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ development.py # Development environment settings
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ production.py # Production environment settings
โ”‚   โ”‚   โ”œโ”€โ”€ .env              # Environment secrets boundary
โ”‚   โ”‚   โ”œโ”€โ”€ .env.example      # Example env file
โ”‚   โ”‚   โ”œโ”€โ”€ asgi.py           # ASGI configuration
โ”‚   โ”‚   โ”œโ”€โ”€ celery.py         # Celery configuration file
โ”‚   โ”‚   โ”œโ”€โ”€ urls.py           # Master URL configuration
โ”‚   โ”‚   โ””โ”€โ”€ wsgi.py           # WSGI configuration
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ media/                # Uploaded media files
โ”‚   โ”œโ”€โ”€ static/               # Static files
โ”‚   โ”œโ”€โ”€ templates/            # Global HTML templates
โ”‚   โ””โ”€โ”€ manage.py             # Django's management script
โ”‚
โ””โ”€โ”€ .gitignore                # Git ignore file

โœ… Requirements

  • Python 3.8+
  • Django 3.2+

๐Ÿง  Why Use It?

  • ๐Ÿ”ฅ Save time and skip repetitive setup

  • ๐Ÿงผ Enforce consistency across teams

  • โšก Fast, interactive, zero-bloat generator


๐Ÿ“„ License

MIT License - See the LICENSE


๐Ÿ”— Links

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

django_structurator-1.3.0.tar.gz (103.0 kB view details)

Uploaded Source

Built Distribution

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

django_structurator-1.3.0-py3-none-any.whl (120.7 kB view details)

Uploaded Python 3

File details

Details for the file django_structurator-1.3.0.tar.gz.

File metadata

  • Download URL: django_structurator-1.3.0.tar.gz
  • Upload date:
  • Size: 103.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for django_structurator-1.3.0.tar.gz
Algorithm Hash digest
SHA256 9b0ae16b80d3bd51f43627a45de32642cc4786634f9f4350186f25f74ceb96f7
MD5 23bb98a8cf6ade5dea3b8b0950898fbb
BLAKE2b-256 429b767f1d94686b2de94dabd0d77a558f289460275705f27b2000c4464c6a91

See more details on using hashes here.

File details

Details for the file django_structurator-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_structurator-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 247c9354d987f8c6316774a0096341d975872e621eab0837e6cad568f60415ef
MD5 09479278c8007b095f7d47228d838771
BLAKE2b-256 6fedbda03d41c93b6b509a710d62dc8ad8a8d60d84706b19d64bb1e73b4db225

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