Skip to content

django-admin

  • If you are inside of a project, using the django-admin wrapper manage.py

startproject

# Create new project
django-admin startproject "<project-name>" # creates a new subfolder
django-admin startproject "<project-name>" "." # installs it in the current existing folder

runserver

# Starting the server
django-admin runserver # at localhost:8000 by default
django-admin runserver "3000" # specify port

startapp

# Add a new App to a Project. It is included as a new folder in the root of the project
# The New app must also be included in the settings.py (INSTALLED_APPS variables) with the same name
django-admin startapp <app-name>

makemigrations

# Creating Migrations
# Check if there are alterations in the model.py files
django-admin makemigrations

migrate

# Migrate the Database
django-admin migrate

createsuperuser

# Creating a Super User for the Admin Panel
python3 manage.py createsuperuser

changepassword

# Change passwords
python3 manage.py changepassword

collectstatic

# Collecting Static Files Into One Folder
python3 manage.py collectstatic