Passed
Push — mvp ( 695450...c6ab63 )
by Yohann
54s
created

app   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 38
dl 0
loc 58
rs 10
c 0
b 0
f 0
wmc 6

6 Functions

Rating   Name   Duplication   Size   Complexity  
A dashboard_page() 0 3 1
A legal_page() 0 3 1
A delete_account_page() 0 3 1
A register_page() 0 3 1
A index_page() 0 3 1
A login_page() 0 3 1
1
from flask import Flask, render_template
2
from flask_sqlalchemy import SQLAlchemy
3
4
app = Flask(__name__)
5
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///bday.db'
6
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
7
db = SQLAlchemy(app)
8
9
10
# DB Model
11
class User(db.Model):
12
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
13
    pseudo = db.Column(db.String(32))
14
    password = db.Column(db.String(128))
15
    birthday = db.Column(db.Date, default=None)
16
17
18
class Birthday(db.Model):
19
    id = db.Column(db.Integer, primary_key=True)
20
    user_id = db.Column(db.Integer, primary_key=True)
21
    person_name = db.Column(db.String(32))
22
    person_birthday = db.Column(db.Date)
23
24
25
@app.route('/')
26
def index_page():
27
    return render_template('index.html')
28
29
30
@app.route('/auth/login')
31
def login_page():
32
    return render_template('auth/login.html')
33
34
35
@app.route('/auth/register')
36
def register_page():
37
    return render_template('auth/register.html')
38
39
40
@app.route('/dashboard')
41
def dashboard_page():
42
    return render_template('dashboard.html')
43
44
45
@app.route('/auth/delete')
46
def delete_account_page():
47
    return render_template('auth/delete.html')
48
49
50
@app.route('/legal')
51
def legal_page():
52
    return render_template('legal.html')
53
54
55
if __name__ == '__main__':
56
    db.create_all()
57
    app.run(debug=True)
58