Gourav Goyat

Commonly used django commands

01 Jul 2024


Create a new project

django-admin startproject myproject

Running the above command creates myproject directory nested inside another myproject directory. If you do not want this nested structure, use the following

django-admin startproject myproject .

Create a new app

python manage.py startapp myapp

Create admin user

python manage.py createsuperuser

Change admin password

python manage.py changepassword <admin_username>

Make migrations

python manage.py makemigrations

Run migrations

python manage.py migrate

Collect static files

python manage.py collectstatic

Run dev server

python manage.py runserver

Open django shell

python manage.py shell