Convention over configuration for Django - Rails-like scaffolding and generators
Project description
djx-cli — Django Express
Convention over configuration for Django. Inspired by Ruby on Rails.
3 commands. Full CRUD app. No boilerplate.
pip install djx-cli
djx new myblog && cd myblog
djx scaffold Post title:string content:text published:boolean
python manage.py migrate && python manage.py runserver
# → http://127.0.0.1:8000/posts/ — list, create, edit, delete. Done.
Why DJX?
Django is powerful but verbose. Starting a new feature means manually creating models, views, templates, URLs, and wiring them together. DJX does all of that in one command — the same way Rails has done it for 20 years.
| Task | Django | DJX |
|---|---|---|
| New project | django-admin startproject + manual venv + settings |
djx new myproject |
| New CRUD feature | model + views + urls + templates (manual) | djx scaffold Post title:string |
| See all routes | no built-in command | djx routes |
| Remove a feature | delete files manually | djx destroy scaffold Post |
Installation
pip install djx-cli
Requires Python 3.8+ and works with Django 4.2+.
Quick Start
# 1. Create a new project — venv, Django, git, migrations all automatic
djx new myblog
cd myblog
source venv/bin/activate # Linux/Mac
# venv\Scripts\activate # Windows
# 2. Scaffold a full CRUD feature
djx scaffold Post title:string content:text published:boolean
# 3. Run migrations and start server
python manage.py makemigrations && python manage.py migrate
python manage.py runserver
Visit http://127.0.0.1:8000/posts/ — you have a working list, create, edit, and delete. No code written.
Commands
djx new <project>
Create a new Django project with everything configured.
djx new myproject
Creates: Django project, git repository, README, initial migrations. Asks if you want a virtual environment created automatically.
djx scaffold <Model> <fields>
Generate a complete CRUD feature — model, views, templates, and URLs all wired together.
djx scaffold Post title:string content:text published:boolean
djx scaffold Comment body:text author:string post:references:Post
Generates:
posts/models.py— model with all fieldsposts/views.py— ListView, DetailView, CreateView, UpdateView, DeleteViewposts/templates/posts/— list, detail, form, confirm_delete templatesposts/urls.py— all routes- Wired into project
urls.pyautomatically - Added to
INSTALLED_APPSautomatically
djx model <Model> <fields>
Generate a model only (no views or templates).
djx model Article title:string body:text author:string
djx controller <Model>
Generate views and templates for an existing model.
djx controller Post
djx destroy <type> <Model>
Clean removal of a scaffold, model, or controller.
djx destroy scaffold Post # removes app, URLs, INSTALLED_APPS entry
djx destroy model Post # removes model only
djx destroy controller Post # removes views and templates only
djx routes
Display all registered URL routes in a clean table.
djx routes
📍 Routes
URL Pattern Name View
=====================================================
posts/ post-list ListView
posts/<int:pk>/ post-detail DetailView
posts/new/ post-create CreateView
posts/<int:pk>/edit/ post-update UpdateView
posts/<int:pk>/delete/ post-delete DeleteView
✓ Total routes: 28
djx db
Shortcut for the most common database workflow.
djx db # makemigrations + migrate in one command
djx db reset # flush + migrate (wipe and rebuild)
djx console
Django shell with all your models already imported — no manual imports needed.
djx console
# ✓ Models loaded: Post, Comment, User
# >>> Post.objects.all()
djx add <package>
Install a package and add it to INSTALLED_APPS automatically.
djx add django-crispy-forms
djx add djangorestframework
djx config <KEY> <value>
Set a value in settings.py from the terminal.
djx config DEBUG False
djx config ALLOWED_HOSTS '["*"]'
djx wire <app>
Manually wire an app's URLs into the project urls.py.
djx wire posts
Field Types
| DJX type | Django field |
|---|---|
string |
CharField(max_length=200) |
text |
TextField() |
integer |
IntegerField() |
boolean |
BooleanField() |
date |
DateField() |
datetime |
DateTimeField() |
decimal |
DecimalField() |
email |
EmailField() |
url |
URLField() |
references:Model |
ForeignKey(Model) |
Project Structure
After djx new myblog && djx scaffold Post title:string content:text:
myblog/
├── manage.py
├── README.md
├── myblog/
│ ├── settings.py
│ └── urls.py
└── posts/
├── models.py
├── views.py
├── urls.py
├── migrations/
└── templates/
└── posts/
├── post_list.html
├── post_detail.html
├── post_form.html
└── post_confirm_delete.html
Conventions
DJX follows these conventions so you don't have to think about them:
- App name is the pluralized, lowercased model name (
Post→posts) - Templates follow
app/model_action.htmlpattern - URLs follow RESTful patterns (
/posts/,/posts/new/,/posts/1/edit/) - All models get
created_atandupdated_atautomatically - Apps are auto-added to
INSTALLED_APPS - URLs are auto-wired to the project
urls.py
Contributing
Contributions are welcome! DJX is early-stage and there's a lot to build.
git clone https://github.com/RedsonNgwira/djx-cli.git
cd djx-cli
pip install -e .
djx --help
See CONTRIBUTING.md for guidelines.
Ideas for contributions:
djx console— Django shell with all models auto-importeddjx generate api— DRF REST API scaffolddjx server— runserver with better defaultsdjx db migrate— shortcut for makemigrations + migrate- Windows compatibility improvements
- More field types
License
MIT — see LICENSE.
Built with ❤️ from Malawi 🇲🇼 by Redson Ngwira
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file djx_cli-0.1.8.tar.gz.
File metadata
- Download URL: djx_cli-0.1.8.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a136ee3d3fc180bb474546faf7e2bf05aea4ca6260afc11d513206224ec2be91
|
|
| MD5 |
e1f80fe8b271f0e865a148d0155cf844
|
|
| BLAKE2b-256 |
01b8edd4f27fa0331ec7958804826c3068b77dc2007efb43166cc43f68bf161e
|
File details
Details for the file djx_cli-0.1.8-py3-none-any.whl.
File metadata
- Download URL: djx_cli-0.1.8-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f40f85aaf975ffd8c7766a3ce87df3c575663eef71615e918fba80d70a490c7c
|
|
| MD5 |
e17825bb78351252fc8daab57f715315
|
|
| BLAKE2b-256 |
bc1cc402597f806e6884e8684df02fded861c93982aec160cb36f1fda444a607
|