-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.py
executable file
·33 lines (25 loc) · 910 Bytes
/
server.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
from flask import Flask, render_template, request, config
from sassutils.wsgi import SassMiddleware
from flask_session import Session
from flask_wtf.csrf import CSRFProtect
from flask_sqlalchemy import SQLAlchemy
from controllers import *
app = Flask(__name__, template_folder='views')
#db = SQLAlchemy(app)
app.config.from_object('config')
#CSRFProtect(app)
Session(app)
app.jinja_env.add_extension('pypugjs.ext.jinja.PyPugJSExtension')
app.wsgi_app = SassMiddleware(app.wsgi_app, {
'static': ('sass/', 'css/', '/static/css')
})
app.register_blueprint(common_controller)
app.register_blueprint(website_controller)
app.register_blueprint(video_controller)
# Error handling is made here because of
# http://flask.pocoo.org/docs/0.10/api/#flask.Blueprint.errorhandler
@app.errorhandler(404)
def not_found(error):
return render_template('errors/404.pug'), 404
if __name__ == "__main__":
app.run()