01 2022 档案

摘要:实现了登录,注册就很简单了 在登录页面放注册的入口: <div class="row cl"> <div class="formControls col-xs-8 col-xs-offset-3" style="margin-left: 65%"> <label for="online"> <a h 阅读全文
posted @ 2022-01-24 15:31 、阿红吖 阅读(130) 评论(0) 推荐(0) 编辑
摘要:admin/views.py中login添加代码:: online = request.form.get('online') if online: # 选择了记住我 session.permanent = True bp.permanent_session_lifetime = timedelta( 阅读全文
posted @ 2022-01-18 18:57 、阿红吖 阅读(292) 评论(0) 推荐(0) 编辑
摘要:admin/forms.py文件添加代码: from wtforms import Form, StringField from wtforms.validators import InputRequired, Length class LoginForm(Form): username = Str 阅读全文
posted @ 2022-01-18 18:41 、阿红吖 阅读(132) 评论(0) 推荐(0) 编辑
摘要:登录页渲染 项目文件中创建目录static,用于存放静态文件,我这里使用的是H-ui.admin_v3.1.3.1,需要的可以自己去下载,将解压后的文件夹中的lib、static、temp放入刚创建的static中。 templates中创建文件:admin/login.html <!DOCTYPE 阅读全文
posted @ 2022-01-18 18:26 、阿红吖 阅读(199) 评论(0) 推荐(0) 编辑
摘要:修改项目文件中apps/admin/models.py文件 from werkzeug.security import generate_password_hash,check_password_hash from exts import db class Users(db.Model): __ta 阅读全文
posted @ 2022-01-18 16:45 、阿红吖 阅读(409) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示