Please enable JavaScript.
Coggle requires JavaScript to display documents.
轉帳銀行 (轉帳功能 (首頁, 註冊, 轉帳), app.py ((from flask import Flask, views, request,…
轉帳銀行
-
app.py
from flask import Flask, views, request, render_template, session
-
-
-
-
app.add_url_rule('/regist/', view_func=RegistView.as_view('regist'))
model.py
定義db 框架 欄位
-
class User(db.Model):
-
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(60), nullable=False)
username = db.Column(db.String(60), nullable=False)
password = db.Column(db.String(60), nullable=False)
deposit = db.Column(db.Float, default=0)
forms
from wtforms import Form,IntegerField,StringField, FloatField
from wtforms.validators import Email , Length, EqualTo, InputRequired, NumberRange
-
class RegistForm(Form):
-
username = StringField(validators=[Length(3,10)])
password = StringField(validators=[Length(1,10)])
-
-
-
-
-
-