Commands
Curated shell and tool commands for Linux, Windows, Python, Git, Django, SQL, and Nginx – searchable, filterable, and copyable with one click.
29 Commands found
No commands found. Try a different search or filter.
-
Django Bash
Check for model changes that would require new migrations
Compares the current model definitions against the existing migration files and reports whether new migrations would be needed, exiting with a non-zero status if so, without writing any migration file (--dry-run is implied by --check). Also performs a read-only consistency check against the migration history table of the default database to verify that already-applied migrations have their dependencies satisfied; if that database is unreachable, this check is skipped with a warning instead of failing.
python manage.py makemigrations --check --dry-run -
Django Bash
Check for unapplied migrations without applying them
Checks whether any migrations are unapplied for the configured database and exits with a non-zero status if so, without actually applying any migration. Reads the migration history table from the database (a read-only query); does not change the schema or any data.
python manage.py migrate --check -
Django Bash
Generate draft models from the existing database schema
Introspects the tables in the configured database and prints a best-effort draft of the Django models matching them to standard output. Connects to the configured database to read its schema (read-only introspection); does not create any files or modify the database.
python manage.py inspectdb -
Django Bash
Generate sequence-reset SQL
Print sequence-reset SQL for the website app; do not execute it automatically. Output depends on the database backend and may be empty.
python manage.py sqlsequencereset website -
Django Bash
Inspect settings differences locally
Show settings that differ from Django defaults. Output can contain secrets: inspect locally and never share or log it.
python manage.py diffsettings -
Django Bash
List all available management commands
Prints every management command available in the current project, grouped by the Django app that provides it. Read-only; does not connect to the database or modify anything.
python manage.py help -
Django Bash
List all available system check tags
Lists the tag names that can be passed to check --tag (e.g. models, urls, admin) to scope which checks run, without performing any checks itself. Read-only; does not connect to the database.
python manage.py check --list-tags -
Django Bash
Locate every source location of a static file
Searches all configured static file locations (STATICFILES_DIRS and installed apps' static directories) for css/site.css, an actual file already present in this project's static directory at that relative path (static/css/site.css under STATICFILES_DIRS), and prints every location where it was found, including which one would actually be served. Replace css/site.css with another static file's path relative to its static root to look up instead. Read-only.
python manage.py findstatic css/site.css -
Django Bash
Open an interactive client for the configured database
Opens the interactive command-line client for the database engine configured in Django settings, using the permissions configured for that connection. The appropriate client must be installed and available on PATH. You can then enter SQL statements, including statements that modify or destroy data, to the extent allowed by the configured database permissions. With the MySQL backend, Django may pass the password to the client through the MYSQL_PWD environment variable; depending on the operating system, process environments may be visible to other processes or users. Do not expose credentials in output or examples.
python manage.py dbshell -
Django Bash
Preview database migrations
Shows which migrations would be applied without actually running them. Does not change the database.
python manage.py migrate --plan -
Django Bash
Preview the SQL statements of a specific migration
Prints the raw SQL statements that the migration 0001 of the website app would execute, without actually running it against the database. website and 0001 refer to an app and migration that already exist in this project; replace them to preview a different migration. Reads the migration history table from the database to resolve the migration graph and uses the connection to determine the correct SQL dialect; does not execute any of the generated statements.
python manage.py sqlmigrate website 0001 -
Django Bash
Preview the SQL that would reset all table data
Prints the SQL statements that the flush command would execute to remove all data from every table and reset auto-increment counters, without actually running them. Connects to the database only to enumerate its existing tables; does not delete any data itself.
python manage.py sqlflush -
Django Bash
Preview which static files would be collected
Shows exactly which static files would be copied into STATIC_ROOT by a real collectstatic run, without actually copying or overwriting anything. Reads the configured STATICFILES_DIRS and each installed app's static directory; does not connect to the database.
python manage.py collectstatic --dry-run -
Django Bash
Print the configured list of installed apps
Runs a one-off Python snippet that prints the INSTALLED_APPS setting exactly as loaded for this invocation, showing every Django app and third-party or project app currently enabled. Requires Django's settings to be loadable (e.g. a valid DJANGO_SETTINGS_MODULE); read-only, does not query the database.
python manage.py shell -c "from django.conf import settings; print(settings.INSTALLED_APPS)" -
Django Bash
Print the top-level URL patterns of the root URLconf
Runs a one-off Python snippet that resolves the project's root URLconf and prints only the top-level URL patterns (the entries directly listed in urlpatterns), not the individual URLs nested inside included URLconfs such as an app's own urls.py. Requires the ROOT_URLCONF setting to point to a valid, importable module; read-only, does not query the database.
python manage.py shell -c "from django.urls import get_resolver; print([str(p.pattern) for p in get_resolver().url_patterns])" -
Django Bash
Run a one-off Python snippet inside the Django environment
Runs the given Python snippet with Django's settings already loaded and exits immediately afterwards, instead of opening an interactive session; this example prints the current value of the DEBUG setting. Read-only; does not query the database.
python manage.py shell -c "from django.conf import settings; print(settings.DEBUG)" -
Django Bash
Run deployment-oriented system checks against the loaded settings
Runs additional checks relevant to production deployments, such as HSTS, SSL redirect, and secret key strength, strictly based on the settings module actually loaded for this invocation (for example via DJANGO_SETTINGS_MODULE or --settings). Read-only; inspects settings values only and does not connect to the database.
python manage.py check --deploy -
Django Bash
Run Django system checks
Runs Django's system check framework to detect common configuration problems. Must be run from the project root.
python manage.py check -
Django Bash
Run only one app's tests with the --keepdb option
Runs only the tests belonging to the website app and passes --keepdb, which tells Django to preserve a file-based test database between separate runs instead of recreating it every time. For this project's current SQLite configuration, which defaults to an in-memory test database, that persistence benefit does not actually carry over between separate manage.py test invocations (each is a new process and the in-memory database is destroyed when it exits); --keepdb mainly speeds up repeated runs when the test database is file-based (e.g. MySQL/PostgreSQL, or SQLite configured with an explicit on-disk TEST NAME). This substitution of a test database for every configured alias is what keeps the originally configured database untouched by the runner itself, though it does not constrain what a specific test's own code might otherwise do with a direct connection.
python manage.py test website --keepdb -
Django Bash
Run only the model-related system checks
Runs only the system checks tagged models, validating field definitions, relations, and Meta options of installed models, instead of the full check suite. Read-only; model checks inspect code and app configuration and do not require a database connection.
python manage.py check --tag models -
Django Bash
Run system checks including the database checks for the default connection
Runs the regular system check suite exactly as plain check would, and additionally enables the checks tagged database for the default database alias; --database does not restrict the run to only the database tag. Whether the added database checks actually open a connection depends on the backend: for example, the MySQL backend queries the active SQL mode (which requires a reachable connection and fails if the database cannot be reached), while the SQLite backend used by this project performs no such check and needs no connection at all. Read-only with respect to data in all cases; never modifies any table.
python manage.py check --database default -
Django Bash
Run tests in parallel across all CPU cores
Runs the test suite using one worker process per detected CPU core instead of a single sequential process, which can noticeably reduce total run time on larger suites on supported platforms. Per Django's own documentation, this feature isn't available on Windows at all (it also doesn't work with the Oracle database backend), and it requires the third-party tblib package, installed separately via pip, to display worker tracebacks correctly. Each worker gets its own separate temporary test database; Django's default test runner substitutes these for every configured database alias and destroys them afterward, which is what keeps the originally configured database untouched by the runner itself, without constraining what a specific test's own code might otherwise do with a direct connection. Output ordering may differ from a sequential run.
python manage.py test --parallel auto -
Django Bash
Run the full test suite with detailed output
Runs every test in the project and prints a detailed, per-test result line instead of just dots. Django's default test runner creates a dedicated, temporary test database for each configured database alias before running and destroys it afterwards; this substitution is what keeps the originally configured database itself untouched by the runner, though it only covers the runner's own connection handling, not whatever a specific test's own code might otherwise do with a direct connection.
python manage.py test --verbosity 2 -
Django Bash
Show detailed help for a specific management command
Prints the full usage text, arguments, and options for the migrate command (used here as an example) without actually running it. Replace migrate with the name of any other command to see its help instead. Read-only; does not connect to the database.
python manage.py help migrate -
Django Bash
Show migration dependency order
Show the migration plan and applied markers without applying migrations. Requires access to the configured database.
python manage.py showmigrations --plan -
Django Bash
Show which migrations are applied for each app
Lists every migration grouped by app with an [X] or [ ] marker showing whether it has already been applied to the configured database. Reads the migration history table from the database (a lightweight metadata query); does not apply or change any migration.
python manage.py showmigrations -
Django Bash
Start an interactive Python shell with Django configured
Opens an interactive Python REPL with Django's settings already loaded, so models, settings, and the ORM can be used directly without manual setup. Opens an interactive session that stays open until exited explicitly; no database queries or changes occur unless code is actually typed and run inside it.
python manage.py shell -
Django Bash
Start the local development server
Starts Django's built-in development server bound exclusively to the local machine (127.0.0.1) on port 8000, with auto-reload on code changes enabled. Before starting, Django reads the migration history table of the default database to warn about unapplied migrations; the server fails to start if that database is unreachable. This server is intended only for local development, is not hardened or performant enough for production use, and runs in the foreground until stopped with Ctrl+C.
python manage.py runserver 127.0.0.1:8000 -
Django Bash
Stop tests after the first failure
Run the website app's tests and stop at the first failure. Use isolated local test settings, never production database credentials.
python manage.py test website --failfast