Tag: pattern color DMI Text Request body Display a cut
##
route to view functions via URLs login (), return HTML file
urls.py
fromDjango.contribImportAdmin fromDjango.urlsImportPathFrom CMDB import Views urlpatterns=[Path ('admin/', Admin.site.urls),Path ('login/', Views.login),]
##
views.py
From django.shortcuts import renderfrom django.shortcuts import httpresponse# Create your views here.def login (Request): C3/>return render (Request, ' login.html ') def CMDB (request): return HttpResponse (' CMDB ')
##
Login.html
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Title</title></Head><style>label{width:80px;text-align: Right;Display:Inline-block; }</style><Body> <formAction= "/login"Method= "POST"> <P> <label for= "username">User name:</label> <inputID= "username"type= "text" /> </P> <P> <label for= "Password">Password:</label> <inputID= "Password"type= "text" /> <inputtype= "Submit"value= "Submit"/> </P> </form></Body></HTML>
##
#Django a simple HTTP request