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 manage.py startapp APPNAME
Code language: CSS (css)
To run the web server. Using SUDO you can set the server to run on Port 80
python3 manage.py runserver
Code language: CSS (css)
sudo python3 manage.py runserver 0.0.0.0:80
Code language: CSS (css)
To update the Database from the Models.py file:
python3 manage.py makemigrations
Code language: CSS (css)
python3 manage.py migrate
Code 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 Models.py fiile.
python3 manage.py createsuperuser
Code language: CSS (css)