django-extensions
Django Extensions
This project has django-extensions installed. Use these commands to understand and interact with the Django project.
Introspection
Show URL Routes
python manage.py show_urls
List Model Information
# All models
python manage.py list_model_info
# Specific model with signatures and field classes
python manage.py list_model_info --model <app.Model> --signature --field-class
# All methods including private
python manage.py list_model_info --model <app.Model> --all-methods --signature
Print Settings
# All settings
python manage.py print_settings --format=pprint
# Wildcards supported
python manage.py print_settings AUTH*
python manage.py print_settings DATABASE*
python manage.py print_settings *_DIRS
Show Permissions
python manage.py show_permissions
python manage.py show_permissions <app_label>
Show Template Tags
python manage.py show_template_tags
Development
Enhanced Shell (shell_plus)
python manage.py shell_plus
python manage.py shell_plus --print-sql
Auto-imports all models. Use --dont-load app1 to skip apps.
Enhanced Dev Server (runserver_plus)
python manage.py runserver_plus
python manage.py runserver_plus --print-sql
Includes Werkzeug debugger for interactive debugging.
Database
SQL Diff (Compare Models to Schema)
python manage.py sqldiff -a # SQL differences
python manage.py sqldiff -a -t # Text differences (readable)
Script Execution
Run Scripts with Django Context
python manage.py runscript <script_name>
python manage.py runscript <script_name> --script-args arg1 arg2
python manage.py runscript <script_name> --traceback
Scripts in scripts/ directory must define a run() function.
Profiling
Profile Server Requests
python manage.py runprofileserver --prof-path=/tmp/profiles
python manage.py runprofileserver --use-cprofile --prof-path=/tmp/profiles
python manage.py runprofileserver --kcachegrind --prof-path=/tmp/profiles
Notes
- Model notation:
app.ModelName(e.g.,core.EmailAccount,metabox.Thread) - Settings wildcards:
AUTH*,*_DIRS,DATABASE* - Commands run from project root
More from kjnez/claude-code-django
htmx-patterns
HTMX patterns for Django including partial templates, hx-* attributes, and dynamic UI without JavaScript. Use when building interactive UI, handling AJAX requests, or creating dynamic components.
31django-templates
Django template patterns including inheritance, partials, tags, and filters. Use when working with templates, creating reusable components, or organizing template structure.
30pytest-django-patterns
pytest-django testing patterns, Factory Boy, fixtures, and TDD workflow. Use when writing tests, creating test factories, or following TDD red-green-refactor cycle.
24django-forms
Django form handling patterns including ModelForm, validation, clean methods, and HTMX form submission. Use when building forms, implementing validation, or handling form submission.
16celery-patterns
Celery task patterns including task definition, retry strategies, periodic tasks, and best practices. Use when implementing background tasks, scheduled jobs, or async processing.
15django-models
Django model design patterns emphasizing fat models/thin views, QuerySet optimization, and domain logic encapsulation. Use when designing models, optimizing queries, implementing business logic, or working with the ORM.
14