一百一十三:CMS系统之前台注册界面
html
{% from 'common/_macros.html' import static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>前台注册</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: #f3f3f3;
}
.outer-box{
width: 854px;
background: #fff;
margin: 0 auto;
overflow: hidden;
}
.logo-box{
text-align: center;
padding-top: 40px;
}
.logo-box img{
width: 60px;
height: 60px;
}
.page-title{
text-align: center;
}
.sign-box{
width: 300px;
margin: 0 auto;
padding-top: 50px;
}
</style>
</head>
<body>
<div class="outer-box">
<div class="logo-box">
<a href="/"><img src="{{ static('common/images/logo.png') }}" alt=""></a>
</div>
<h2 class="page-title">注册账号</h2>
<div class="sign-box">
<div class="form-group">
<div class="input-group">
<input type="text" class="form-control" name="telephone" placeholder="手机号码">
<span class="input-group-btn"><button class="btn btn-info">发送验证码</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">立即注册</button>
</div>
</div>
</div>
</body>
</html>
视图
from flask import Blueprint, views, render_template
bp = Blueprint("front", __name__)
@bp.route('/')
def index():
return 'front index'
class SignupView(views.MethodView):
def get(self):
return render_template('front/front_signup.html')
bp.add_url_rule('/signup/', view_func=SignupView.as_view('signup'))
讨论群:249728408