The from the django. Shortcuts import HttpResponse
The from the django. Shortcuts import render
The from the django. Shortcuts import redirect
# the Create your views here.
Def index (request) :
Return an HttpResponse (" index ")
Def login (request) :
Print (" @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ")
. If the request method=="GET" :
Print (" * * * * * * * * * * * * * * * * * * ")
Return render (request, "login. HTML")
# return redirect (request, "/index/")
Elif request. The method=="POST" :
V=request. POST. Get (" gender ")
F=request. POST. Getlist (" favor ")
Print (v)
Print (f)
The import OS
Obj=request. FILES. Get (" FFF ")
File_path=OS. Path. Join (" upload ", obj. Name)
F=open (file_path, mode="wb")
For I in obj. Chunks () :
F.w rite (I)
F. lose ()
Return render (request, "login. HTML")
# return redirect (request, "/index/")
The else:
Return redirect (request, "/index/")
Just started to learn, it made a login. The HTML,
Click on the submit, file upload, also have no reaction, what reason be?