-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (27 loc) · 822 Bytes
/
main.py
File metadata and controls
32 lines (27 loc) · 822 Bytes
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
from flask import Flask, render_template, redirect
from User import UserController
from Product import ProductController
from Cart import CartController
from Order import OrderController
from flask_cors import CORS
import logging
log = logging.getLogger('werkzeug')
log.setLevel(logging.ERROR)
app = Flask(__name__)
app.secret_key="ABCD"
CORS(app)
app.register_blueprint(UserController.bp)
app.register_blueprint(ProductController.bp)
app.register_blueprint(CartController.bp)
app.register_blueprint(OrderController.bp)
## 메인페이지 ##
@app.route('/')
def hello():
return render_template('welcome.html')
# 404 에러 핸들러 추가
@app.errorhandler(404)
def page_not_found(e):
return redirect('/')
@app.errorhandler(Exception)
def page_not_found(e):
return render_template('welcome.html', err=e)