https://python.plainenglish.io/setting-up-a-basic-django-project-with-pipenv-7c58fa2ec631 https://youtu.be/F_xWv0Q_dLE https://www.youtube.com/watch?v=tRGV_DoWyrI ' https://www.youtube.com/watch?v=xrovglBdBqk (Template) https://www.youtube.com/watch?v=sv6kMpCcVIs (Static file)
Step-1: Create Folder (BookingEngine) and go into this folder
Step-2: Check Python and Pip is installed or not (python --version, pip --version)
Step-3: Check Django is installed or not (django-admin --version)-> You will get django is not installed.
========= First create pipenv virtual Envirment ==========
Step-4: pip install pipenv (To install the pipenv)
step-5: Check pipenv --version
step-6: Activate pipenv by using commond 'pipenv shell' (It will create file Pipfile)
step-7: To remove the pipenv use commond 'pipenv --rm'
========= Install django and create project ==========
step-8: Install django by using 'pipenv install django' (It will create file Piplock file)
step-9: django-admin startproject BookingEngine . (. into the last is must to create manage.py in root, orhetwise it will create folder within folder)
step-10: python manage.py runserver
step-11: pip freeze > requirements.txt (To generate the requirements.txt)
step-12: Create app : python manage.py startapp users
========= Create Template Folder ==========
step-13: Create Templates folder under the root project BookingEngine with the sub directory if there.
step-14: Go into setting page and create a variable
TEMPLATES_DIR =os.path.join(BASE_DIR,'templates')
After that set this variable into Template directory:
TEMPLATES = [{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [TEMPLATES_DIR], }]
========= Create Static Folder ==========
step-15: Create static folder under the root project BookingEngine
step-16: Go into setting page and create a variable for static folder
STATIC_URL = '/static/'
STATIC_DIR =os.path.join(BASE_DIR,'static')
STATICFILES_DIRS =[STATIC_DIR]
========= Load static file into template==========
{% load static %}
link href="{% static 'css/style.css' %}" OR link href="{% get_static_prefix %}css/style.css"