parent
cac3d691cf
commit
ae2f191f3b
5 changed files with 31 additions and 8 deletions
@ -1,3 +1,8 @@ |
||||
from django.shortcuts import render |
||||
from .forms import * |
||||
|
||||
# Create your views here. |
||||
|
||||
def userinfo_form(request): |
||||
if request.method == "GET": |
||||
myform = UserInfoForm() |
||||
return render(request, "form_demo/userinfo.html", {'form_obj': myform}) |
||||
|
@ -0,0 +1,12 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8"> |
||||
<title>form_demo</title> |
||||
</head> |
||||
<body> |
||||
{% csrf_token %} |
||||
{{ form_obj.as_p }} |
||||
<input type="submit" value="提交"> |
||||
</body> |
||||
</html> |
Loading…
Reference in new issue