-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
56 lines (45 loc) · 1.38 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from main.env import SECRET_KEY
from flask import Flask, render_template, jsonify,request, redirect, Blueprint
from datetime import timedelta
from main.intro import intro
from main.statistics import statistics
from main.login import login
from main.join import join
from main.feed import feed
from main.my_page import mypage
from main.about_us import about_us
from main.forgot_pw import forgot_pw
from main.content_service import content_service
app = Flask(__name__)
app.secret_key = SECRET_KEY
app.config["PERMANENT_SESSION_LIFETIME"] = timedelta(days=3) # 로그인 지속시간을 정합니다. 현재 1분
# Page blueprint
'''
intro : 인트로 페이지
statistics : 통계 페이지
login_join : 로그인 페이지
feed : 피드 페이지
mypage : 마이페이지
about_us : 팀 소개 페이지
'''
app.register_blueprint(intro)
app.register_blueprint(statistics)
app.register_blueprint(login)
app.register_blueprint(join)
app.register_blueprint(feed)
app.register_blueprint(mypage)
app.register_blueprint(about_us)
app.register_blueprint(forgot_pw)
app.register_blueprint(content_service)
# root url
@app.route('/')
def index():
return render_template('intro.html')
#Create Custom Error Pages
#Invalid URL
@app.errorhandler(404)
def page_not_found(e):
return render_template("404.html"), 404
if __name__ == '__main__':
print(SECRET_KEY)
app.run(host='0.0.0.0', debug=True)