Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

Run Server:

python3 runserver

Create DB:

createdb <dbname>

Make migrations:

python3 makemigrations

Migrate DB:

python3 migrate

Create a project:

django-admin startproject <projectname>

Create an app:

python3 startapp main_app

Run Django Shell:

python3 shell

Import models in shell:

from main_app.models import *

Shell commands:

c = Cat.objects.get(id=3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment