3.1 来写个登陆功能
启动Django的guest项目
cd到guest路径 我的本地路径是 ~/LIbrary/Python/3.7/bin/guest/
终端如下
B0178RQ2019070018:guest wangxue$ python3 manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run ‘python manage.py migrate‘ to apply them.
June 16, 2020 - 07:12:48
Django version 3.0.6, using settings ‘guest.settings‘
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
编辑 guest/sign/templates/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Django Page</title>
</head>
<body>
<h1>发布会管理</h1>
<form>
<input name="username" type="text" placeholder="username">
<input name="password" type="password" placeholder="password">
<button id="btn" type="submit">登录</button>
</form>
</body>
</html>
浏览器访问 http://127.0.0.1:8000/index/
原文:https://www.cnblogs.com/suren2017/p/13141125.html