Installed it
pip install django
created a server/ whatever
django-admin startproject mysite
I ran the server
python manage.py runserver
fun fact: the tab completion was working all the way in terminal
created a file manually called “views.py” inside project-name directory.
then, created 2 different pages using “views.py”
# A file created manually!
from django.http import HttpResponse
def index(request):
return HttpResponse("hello")
def about(request):
return HttpResponse("<h1>About Sharafat</h1>")
also linked this with the support of urls.py
from . import views
urlpatterns = [
path('admin/', admin.site.urls), \#default line
path("", views.index, name="index"),
path("about/", views.about, name="about"),
]