-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.py
34 lines (28 loc) · 945 Bytes
/
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
from flask import Flask, render_template, request
from routes.bus_route import bp as bus_bp
from routes.mem_route import bp as mem_bp
from routes.reserve_route import bp as res_bp
from routes.main import bp as main
from bus_info.service import Service
app = Flask(__name__)
app.secret_key = 'zero'
# url이 등록된 bluePrint 객체 등록
# 블루 프린트에 등록한 url을 flask객체가 인식
# 모든 URL을 한 app.py에 등록하면 관리가 어려워 블루프린트를 사용한다.
# 단위 별로 끊어서 url 관리
app.register_blueprint(bus_bp)
app.register_blueprint(mem_bp)
app.register_blueprint(res_bp)
app.register_blueprint(main)
@app.route('/')
def root():
'''
로그인 처리
session['flag'] = True
session['loginid'] = id
로그아웃 처리
session.pop('flag')
session.pop('loginid')'''
return render_template('index.html')
if __name__ == '__main__':
app.run(port=5001) #