首页 > 其他 > 详细

【Django】【一】视图

时间:2020-06-16 15:28:10      阅读:35      评论:0      收藏:0      [点我收藏+]

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/

技术分享图片

 

 

 

 

【Django】【一】视图

原文:https://www.cnblogs.com/suren2017/p/13141125.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!