Commands
Django
You can display all available commands from all Django apps using uv run -- manage.py
. Refer
to Django and each Django app documentation for more information.
Some useful commands:
uv run -- manage.py runserver
- Starts Django development serveruv run -- manage.py fresh
- Resets the database and creates a superuser (seefresh.py
)uv run -- manage.py makemigrations
- Generates migrations based on model changesuv run -- manage.py migrate
- Runs unapplied migrations (syncs the database schema after generating new migration files)uv run -- manage.py sqlmigrate <appname> <migrationfilename>
- Examines a migration file by showing what the generated SQL looks likeuv run -- manage.py sh
- Starts enhanced Python shell with auto-imported models and Django context (IPython is default in Sidewinder)uv run -- manage.py dbshell
- Starts db shell (like PostgreSQL's psql)uv run -- manage.py run_huey
- Starts Huey consumers (this way you can test huey consumers using Redis locally)uv run -- manage.py print_settings
- Prints all Django settingsuv run -- manage.py diffsettings
- See all Django settings that differ from Django's defaultsuv run -- manage.py show_urls
- Shows all urlpatternsuv run -- manage.py show_template_tags
- Displays template tags and filters available in the current projectuv run -- manage.py list_signals
- Prints all defined Django signalsuv run -- manage.py list_model_info
- Prints all models, their attributes and methodsuv run -- manage.py notes
- Shows all annotations like TODO, FIXME, BUG, HACK, WARNING, NOTE or XXX in the py and HTML filesuv run -- manage.py inspectdb
- Generates Django models from the databaseuv run -- manage.py spectacular
- Prints generated OpenAPI schemauv run -- manage.py startapp <name> <projectname>/<name>
- Creates a new Django app inside "projectname" folder (what you chose for renaming the project)uv run -- manage.py createsuperuser
- Creates a new super useruv run -- manage.py changepassword <username>
- Changes a password for a given useruv run -- manage.py generate_secret_key
- Generates Django secret key (useful when needing one for production)uv run -- manage.py admin_generator <appname>
- Generates the contents of admin.py for a given Django appuv run -- manage.py describe_form <appname.ModelName>
- Generates Django form based on a modeluv run -- manage.py drf_create_token <username>
- Generates an API token for a given useruv run -- manage.py makemessages --locale=<locale>
(or--all
) - Creates or updates messages files for translationsuv run -- manage.py compilemessages
- Compiles .po files created by makemessages to .mo filesuv run -- manage.py clear_cache
- Clears Django cacheuv run -- manage.py clean_pyc
- Removes .pyc files from the projectuv run -- manage.py check
- Runs Django check listuv run -- manage.py validate_templates
- Validates Django templatesuv run -- manage.py unreferenced_files
- Lists media files that are not referenced anymore by file fieldsuv run -- manage.py sendtestemail <email@address>
- Sends a test email to the provided email addressuv run -- manage.py raise_test_exception
- Raises a test exception. Useful for testing error reporters such as Sentry
Documentation
Feel free to modify Sidewinder's documentation site in the docs
folder for your needs.
uv run -- mkdocs serve
- Start the live-reloading docs serveruv run -- mkdocs build
- Build the documentation site