Skip to content

Instantly share code, notes, and snippets.

@rafaelmaeuer
Last active April 16, 2025 10:29
Show Gist options
  • Save rafaelmaeuer/5167060dbaf74e5c0b9318951f29bded to your computer and use it in GitHub Desktop.
Save rafaelmaeuer/5167060dbaf74e5c0b9318951f29bded to your computer and use it in GitHub Desktop.

Django Cheat-Sheet

V-Env

Create and Enable Virtual Environment

python -m venv .venv
source .venv/bin/activate

Migrations

Apply migratons (in venv)

python manage.py migrate

Create migrations (in venv)

python manage.py makemigrations

Rollback to specific migration

python manage.py migrate {app_name} {migration_number}

Apply specific migration that might already exist (fake)

python manage.py migrate {app_name} {migration_number} --fake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment