Last active
March 2, 2019 22:40
-
-
Save thibaut-d/bbfc58233330d7eb7efde3a776caef6d to your computer and use it in GitHub Desktop.
Django cheatsheet from the doc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Django | |
! pip install django | |
# Create a project | |
! django-admin startproject mysite . | |
# Launch devlopment server | |
! python manage.py runserver | |
! python manage.py runserver 8080 # Custom port (default to 8000) | |
! python manage.py runserver 0.0.0.0:8080 # Allow external access | |
# Create an app | |
! python manage.py startapp polls | |
# Prepare an app migration | |
! python manage.py makemigrations polls | |
! python manage.py sqlmigrate polls 0001 # Check content | |
# Migrate | |
! python manage.py migrate | |
# Shell | |
! python manage.py shell | |
# Add a superuser | |
! python manage.py createsuperuser |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment