Django Commands

New Django project:

django-admin startproject project_name

Create app (from project_name folder)

python startapp app_name

Makemigrations: Create a file under app_name/migrations with the database structure to create

python makemigrations

Migrate: Will read the migrations files and create the actual database and tables

python migrate

Create superuser for authentication/admin panel

python createsuperuser

Start server

python runserver

Django shell (Run project code directly)

python shell

Take all data from app blog and export in json

python dumpdata blog >myapp.json

Take all data in json file and import in app data table

python loaddata myapp.json