-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathapp.py
45 lines (34 loc) · 908 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
35
36
37
38
39
40
41
42
43
44
45
# coding: utf-8
import os.path
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from database import init_db
from flask import Flask
import config
app = Flask(__name__)
app.config.from_object(config)
def register_blueprints(app):
# Prevents circular imports
from views import posts
from views import reply
from views import user
#from views import admin
app.register_blueprint(posts)
app.register_blueprint(reply)
app.register_blueprint(user)
register_blueprints(app)
"""
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
http_server = HTTPServer(WSGIContainer(app))
http_server.listen(5000)
IOLoop.instance().start()
"""
#from gevent.wsgi import WSGIServer
#http_server = WSGIServer(('',8888),app)
#http_server.serve_forever()
if __name__ == '__main__':
#init_db()
app.run(debug=True)