Django is a web framework of python to create website that is really used to make website now a days and it comes with own authentication and admin panel to change thing or handle crud to your website.

IF you don’t wanna read full https://github.com/KashanAdnan02/Django-Tut clone this repo

How to setup Django project?

  1. install Django using command on your folder

py -m pip install Django==5.2.5 2. then open command prompt on your folder then type

`django-admin startproject myproject`
  1. create your app

    cd myproject

    python [manage.py](<http://manage.py/>) startapp myapp

    Open your code editor

  2. change your urls on your myproject folder urls.py

from django.contrib import admin
from django.urls import path
from myapp import views

urlpatterns = [
    path("admin/", admin.site.urls),
    path("", views.index, name="home"),
    path("about", views.about, name="about"),
    path("contact", views.contact, name="contact")
]
  1. create the urls.py file in your myapp

    from django.urls import path, include
    
    urlpatterns = [
        path('', include("home.urls")),
        path('about', include("about.urls")),
        path('contact', include("contact.urls")),
    ]
    
  2. Then you have to create views for your app to show the website output of your choice views.py myapp folder

from django.shortcuts import render
## The App Items will Show When you will connect it to the templates bcs we are 
## using files of HTML Sos connect the templates folder  
def index(req):
    return render(req,"index.html")

def about(req):
    return render(req,"about.html")

def contact(req):
    return render(req,"contact.html")

  1. Then add your templates using the settings.py file in the myproject folder
  'DIRS': [Path(__**file__**).resolve().parent.parent / "templates"],
  1. Create a templates folder outside of your myproject folder and create html files for templates

    image.png

  2. (Optional) if you want to save some on your static files in the django server so first create a static folder outside of your projects

## ADDED MUNALLY
STATICFILES_DIRS = [
    BASE_DIR / "static",
    "/var/www/static/",
]