Flask实战第39天:完成前台注册界面
在template下创建目录front,该目录用于存放前台页面的所有模板
在front下创建登录模板
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>注册-BBS论坛</title> <script src="http://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
<link href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script src="http://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <style>
body{
background-color: #8CD4F5;
} .page-title {
text-align: center;
padding-top: 50px;
}
.out-box{
width: 845px;
background-color: white;
margin: 0 auto;
margin-top: 50px; } .page-title {
text-align: center;
padding-top: 80px;
} .form-box{
padding-top: 50px;
padding-bottom: 50px;
width: 300px;
margin: 0 auto;
}
</style>
</head>
<body> <div class="out-box">
<h2 class="page-title">注册BBS论坛</h2>
<div class="form-box">
<div class="form-group">
<div class="input-group">
<input type="text" class="form-control" name="telephone" placeholder="手机号码">
<span class="input-group-btn">
<button id="sms-captcha-btn" class="btn btn-default">发送验证码</button>
</span>
</div>
</div> <div class="form-group">
<input type="text" class="form-control" name="sms_captcha" placeholder="短信验证码">
</div> <div class="form-group">
<input type="text" class="form-control" name="username" placeholder="用户名">
</div> <div class="form-group">
<input type="password" class="form-control" name="password1" placeholder="密码">
</div> <div class="form-group">
<input type="password" class="form-control" name="password2" placeholder="确认密码">
</div> <div class="form-group">
<div class="input-group">
<input type="text" class="form-control" name="graph_captcha" placeholder="图形验证码">
<span class="input-group-addon">
图形验证码
</span>
</div>
</div> <div class="form-group">
<button class="btn btn-warning btn-block" id="submit-btn">立即注册</button>
</div>
</div> </div> </body>
</html>
front_signup.html
在front中编写视图,编辑front.views.py
from flask import (
Blueprint,
views,
render_template
) bp = Blueprint('front', __name__) @bp.route('/')
def index():
return 'front index' class SignUpViews(views.MethodView):
def get(self):
return render_template('front/front_signup.html') def post(self):
pass bp.add_url_rule('/signup/', view_func=SignUpViews.as_view('signup'))
访问http://127.0.0.1:5000/signup/
Flask实战第39天:完成前台注册界面的更多相关文章
- 一百一十三:CMS系统之前台注册界面
html {% from 'common/_macros.html' import static %}<!DOCTYPE html><html lang="en" ...
- Flask实战第38天:前台模型创建
安装shortuuid pip install shortuuid 编辑front.models.py from exts import db import shortuuid from werkze ...
- Flask实战-留言板-安装虚拟环境、使用包组织代码
Flask实战 留言板 创建项目目录messageboard,从GreyLi的代码中把Pipfile和Pipfile.lock文件拷贝过来,这两个文件中定义了虚拟环境中需要安装的包的信息和位置,进入m ...
- WordPress添加前台注册功能
一.添加注册表单 1.首先在当前主题的目录下新建一个php文件,命名为reg-page.php,然后将page.php中的所有代码复制到reg-page.php中: 2.删除reg-page.php开 ...
- HTML连载56-网易注册界面实战之全部代码
一.今天完成了网易邮箱注册界面的全部编写,编写一个小小的网页就需要这么多时间来进行设计.测量.排版.编写.测试,才能进行使用,同时编写这个网页复习了几乎前面的所有内容,最后来一个汇总就可以了. < ...
- JFinal Web开发学习(五)注册界面和后端验证
效果: 直接点击注册后 : 后端验证是可靠地,前端js验证是不可靠的.只需要在浏览器删除js验证代码即可突破js验证. 1.注册界面 在WebRoot下新建regist.jsp <%@ page ...
- HTML登录注册界面怎么制作?
在没有学习CSS样式的前提下,是如何做一个简单的注册界面的. 一.表单标签(form) 首先我们先写一个<form></form>的标签,form标签属于表单标签,通常我们的登 ...
- iOS开发——UI进阶篇(八)pickerView简单使用,通过storyboard加载控制器,注册界面,通过xib创建控制器,控制器的view创建,导航控制器的基本使用
一.pickerView简单使用 1.UIPickerViewDataSource 这两个方法必须实现 // 返回有多少列 - (NSInteger)numberOfComponentsInPicke ...
- HTML练习----注册界面
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
随机推荐
- Enterprise Architect13 : 去掉UML图页面右侧那一道竖线
我们在使用Enterprise Architect 中,画用例图,时序图时,页面右侧有一条竖线,见下图: 如果页面元素太多,会超出竖线的范围,显得很不协调. 如果像去掉竖线,只需选择主菜单的Layou ...
- 两台linux服务器之间免密scp,在A机器上向B远程拷贝文件
两台linux服务器之间免密scp,在A机器上向B远程拷贝文件 操作步骤:1.在A机器上,执行ssh-keygen -t rsa,一路按Enter,不需要输入任何内容.(如有提示是否覆盖,可输入y后按 ...
- Codeforces 321E Ciel and Gondolas
传送门:http://codeforces.com/problemset/problem/321/E [题解] 首先有一个$O(n^2k)$的dp. # include <stdio.h> ...
- jquery的基础语法、选取元素、操作元素、加事件、挂事件及移除事件
jquery基础知识 1.jquery文件的引入,所有的js代码要写在下面那段代码下面. <script src="../jquery-1.11.2.min.js">& ...
- TOJ 1005 Hero In Maze (深搜)
描述 500年前,Jesse是我国最卓越的剑客.他英俊潇洒,而且机智过人^_^. 突然有一天,Jesse心爱的公主被魔王困在了一个巨大的迷宫中.Jesse听说这个消息已经是两天以后了,他知道公主在迷宫 ...
- js函数定义方法
1.函数声明 其语法为 function functionName(){ //函数体 } 首先是function关键字,然后是函数名,其重要特征是函数声明提升,即在执行代码之前会先读取函数声明,使其在 ...
- perl HTML::LinkExtor模块(2)
use LWP::Simple; use HTML::LinkExtor; $html_code = get("https://tieba.baidu.com/p/4929234512&qu ...
- Windows10下配置Linux下C语言开发环境
今天为大家介绍如在Windows10下配置Linux下C语言开发环境,首先安装linux子系统:启用开发者模式 1.打开设置 2.点击更新和安全3.点击开发者选项 4.启用开发人员模式 5.更改系统功 ...
- python基础===多线程
https://www.cnblogs.com/wj-1314/p/8263328.html threading 模块 先上代码: import time, threading def loop(): ...
- python基础===zmail,收发邮件的模块
项目地址: GitHub:https://github.com/ZYunH/zmail 介绍: https://mp.weixin.qq.com/s?__biz=MzAxMjUyNDQ5OA==&a ...