上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 32 下一页
摘要: BBS论坛(十七) 17.首页导航条实现和代码抽离 (1)temlates/common/_head.html <meta name="csrf-token" content="{{ csrf_token() }}"> <script src="http://cdn.bootcss.com/jque 阅读全文
posted @ 2018-11-26 16:23 王竹笙 阅读(209) 评论(0) 推荐(0)
摘要: BBS论坛(十六) 16.登录功能完成 (1)front/forms.py class SigninForm(BaseForm): telephone = StringField(validators=[Regexp(r'1[3578]\d{9}', message='请输入正确格式的手机号码')] 阅读全文
posted @ 2018-11-26 16:21 王竹笙 阅读(216) 评论(0) 推荐(0)
摘要: BBS论坛(十五) 15.1.登录界面完成 (1)front/signbase.html {% from 'common/_macros.html' import static %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF 阅读全文
posted @ 2018-11-26 16:20 王竹笙 阅读(297) 评论(0) 推荐(0)
摘要: BBS论坛(十四) 14.1注册完成跳到上一个页面 (1)front/form.py # front/forms.py __author__ = 'derek' from ..forms import BaseForm from wtforms import StringField from wtf 阅读全文
posted @ 2018-11-26 16:19 王竹笙 阅读(170) 评论(0) 推荐(0)
摘要: BBS论坛(十三) 13.1点击更换图形验证码 (1)front/signup.html <div class="form-group"> <div class="input-group"> <input type="text" class="form-control" name="graph_ca 阅读全文
posted @ 2018-11-26 16:18 王竹笙 阅读(282) 评论(0) 推荐(0)
摘要: BBS论坛(十二) 12.1.图形验证码生成 (1)utils/captcha/init.py import random import string # Image:一个画布 # ImageDraw:一个画笔 # ImageFont:画笔的字体 from PIL import Image,Imag 阅读全文
posted @ 2018-11-26 16:16 王竹笙 阅读(211) 评论(0) 推荐(0)
摘要: BBS论坛(十) 10.1.客户端权限验证功能完成 (1)cms/cms_profile 显示当前用户的角色和权限 <tr> <td>角色:</td> <td> {% for role in user.roles %} {{ role.name }} {% if not loop.last %},{ 阅读全文
posted @ 2018-11-26 16:11 王竹笙 阅读(299) 评论(0) 推荐(0)
摘要: BBS论坛(九) 9.1.权限和角色模型定义 (1)cms/models class CMSPermission(object): ALL_PERMISSION = 0b11111111 # 1.访问者的权限 VISITOR = 0b00000001 # 2.管理帖子的权限 POSTER = 0b0 阅读全文
posted @ 2018-11-26 16:09 王竹笙 阅读(255) 评论(0) 推荐(0)
摘要: BBS论坛(八) 8.1.发送邮箱验证码功能 (1)cms/resetemail.html {% from 'common/_macros.html' import static %} {% block head %} <script src="{{ static('cms/js/resetemai 阅读全文
posted @ 2018-11-26 16:07 王竹笙 阅读(512) 评论(0) 推荐(0)
摘要: BBS论坛(六) 6.1.优化json数据的返回 (1)新建utils/restful.py # utils/restful.py from flask import jsonify class HttpCode(object): ok = 200 unautherror = 401 paramse 阅读全文
posted @ 2018-11-26 16:02 王竹笙 阅读(327) 评论(0) 推荐(0)
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 32 下一页