Convention over configuration for Django - Rails-like scaffolding and generators
Project description
djx-cli
Convention over configuration for Django. Rails-like scaffolding and generators.
Installation
pip install djx-cli
Quick Start
# Create new project (venv, Django, git - all automatic)
djx new myproject
cd myproject
source venv/bin/activate
# Generate full CRUD
djx scaffold Post title:string content:text published:boolean
# Run migrations
python manage.py makemigrations && python manage.py migrate
# Start server
python manage.py runserver
Visit: http://127.0.0.1:8000/posts/
Commands
Project Management
djx new myproject # Create new Django project with venv, git
djx routes # Display all URL routes
Generators
djx scaffold Post title:string body:text published:boolean
djx scaffold Comment post:references author:string content:text
djx model User email:email name:string age:integer
djx controller Post
djx migration add_index_to_posts
Destroy
djx destroy scaffold Post # Remove app, URLs, settings entry
djx destroy model Post # Remove model only
djx destroy controller Post # Remove views/templates only
Configuration
djx config DEBUG False
djx config ALLOWED_HOSTS '["localhost", "127.0.0.1"]'
djx add django-crispy-forms # Install + add to INSTALLED_APPS
Field Types
string→ CharFieldtext→ TextFieldinteger→ IntegerFieldboolean→ BooleanFielddate→ DateFielddatetime→ DateTimeFielddecimal→ DecimalFieldemail→ EmailFieldurl→ URLFieldreferences:Model→ ForeignKey
Example Workflow
# Create project
django-admin startproject myproject
cd myproject
# Generate scaffold
djx scaffold Article title:string content:text published:boolean
# Run migrations
python manage.py makemigrations
python manage.py migrate
# Start server
python manage.py runserver
Visit: http://localhost:8000/articles/
Architecture
Trade-offs:
- ✓ Faster development, less boilerplate
- ✓ Consistent structure across projects
- ✗ Less explicit than pure Django
- ✗ Opinionated URL patterns
Conventions:
- Auto-creates app if missing (pluralized model name)
- Auto-wires URLs to project
- Auto-adds apps to INSTALLED_APPS
- CRUD views use class-based views
- Templates follow
app/model_action.htmlpattern
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
djx_cli-0.1.1.tar.gz
(12.9 kB
view details)
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
djx_cli-0.1.1-py3-none-any.whl
(15.2 kB
view details)
File details
Details for the file djx_cli-0.1.1.tar.gz.
File metadata
- Download URL: djx_cli-0.1.1.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb9d688546f8ca012a403a4b5d9c6368ceb9b557fe570a9f3d386e645389a558
|
|
| MD5 |
fbf30ca0bede6983688446e7b3fcd2cd
|
|
| BLAKE2b-256 |
31ddbfd0d75172e240d0eb7177f78d76e4fcac14e73f1f274e09b7920c2e0054
|
File details
Details for the file djx_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: djx_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.2 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 |
2337923c17ca81f6be99d19067f7a16d47291eab381f9f6012591d1bb8261987
|
|
| MD5 |
8906e7a5e1131991ce3275b857d54766
|
|
| BLAKE2b-256 |
188d802c69fbdc8ab50b3e46c0fb97ff8ac6c1e58c4f9f9f71c716d0603a1cf5
|