Django CLI Commands

To Install Django onto Ubuntu when not using virtual environments:

sudo apt install python3-django

To create the Project:

django-admin startproject PROJECTNAME

To create the App:

python3 startapp APPNAMECode language: CSS (css)

To run the web server. Using SUDO you can set the server to run on Port 80

python3 runserverCode language: CSS (css)
sudo python3 runserver language: CSS (css)

To update the Database from the file:

python3 makemigrationsCode language: CSS (css)
python3 migrateCode language: CSS (css)

To create a Super User account for Django so you can access the GUI web dashboard. Make sure to run makemigrations and migrate at least once even if you haven’t edited the fiile.

python3 createsuperuserCode language: CSS (css)