Sunday, March 7, 2021

django day3

#urls.py from django.contrib import admin from django.urls import path,include from . import views urlpatterns = [ path('',views.home,name="home"), path('contact',views.contact,name="contact"), path('aboutus',views.aboutus,name="aboutus"), path('admin/', admin.site.urls), ] #views.py from django.http import HttpResponse def home(request): #1+2 #HttpResponse("

this is homepage

") return HttpResponse("

this is firstpage

") def contact(request): return HttpResponse("

this is contactpage

") def aboutus(request): return HttpResponse("

about page

")

No comments:

Post a Comment

python class topic video