Django Installation Process:
sudo apt-get install python3-pip
sudo pip3 install virtualenv virtualenv venv source venv/bin/activate deactivate
pip install Django django-admin --version
django-admin startproject python manage.py runserver
- Go to current environment and activate it
pip uninstall django
- Now uninstall virtual environment which is currently active after deactivating it deactivate
sudo rm -rf venv
pip freeze > requirements.txt
pip install -r requirements.txt
python manage.py startapp
- Creating application is not enough we have also to install application in our project
- We install application in our project settings.py file, this is cumpulsory otherwise Application won't be recongnized by Django In Settings.py file : @code INSTALLED_APPS = [ django.contrib.admin,...., '<applicationName 1>' '<applicationName 2> ]
python manage.py makemigrations
python manage.py migrate
python manage.py showmigrations
python manage.py createsuperuser