Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
bennie-asi committed Aug 25, 2022
1 parent 218fe3d commit 1573f66
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app01/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@

# Create your views here.
def index(request):
return HttpResponse("欢迎使用")
print(request.method)
print(request)
print(request.user.email)
return render(request, 'index.html')
2 changes: 1 addition & 1 deletion python/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
# 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
Expand Down
14 changes: 14 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>index</title>
</head>
<body>
<form action="" method="post">
username:<input type="text" name="username"><br/>
password:<input type="password" name="password">
<input type="submit" value="提交">
</form>
</body>
</html>

0 comments on commit 1573f66

Please sign in to comment.