README.md
April 15, 2026 ยท View on GitHub
๐ 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
- GitHub Repo: maulik-0207/django-structurator
- PyPI Package: django-structurator