Skip to main content

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 → CharField
  • text → TextField
  • integer → IntegerField
  • boolean → BooleanField
  • date → DateField
  • datetime → DateTimeField
  • decimal → DecimalField
  • email → EmailField
  • url → URLField
  • references: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.html pattern

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

djx_cli-0.1.2.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

djx_cli-0.1.2-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file djx_cli-0.1.2.tar.gz.

File metadata

  • Download URL: djx_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for djx_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4cbff0be0bfbaeab4e62e81b361b64223a98b7b2caf98c4c4163574d8e6ba192
MD5 aa6d2498e982a11359caa0adfbd991b4
BLAKE2b-256 78c746a05577a6cf3fd0204b190141772d8ce6fd16a652c18bf2622e427ea31d

See more details on using hashes here.

File details

Details for the file djx_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: djx_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for djx_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6240e727792be5d9d816d4a8b25ba016048e6abcc8e54f615475d0c014a6c256
MD5 674be50bba4f241f301952e95a1c5e27
BLAKE2b-256 17822bae56459705c27b21bb8bbee99c491cc4119bde4d3a8e69672dea00c251

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