2011-09-09 21:21:37 +02:00
|
|
|
from web import main, db, mail
|
2011-09-11 22:11:36 +02:00
|
|
|
from api import api
|
2011-10-13 21:27:56 +02:00
|
|
|
import os
|
2011-09-09 21:21:37 +02:00
|
|
|
|
|
|
|
from flask import *
|
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
app.config.from_object("default_settings")
|
2011-10-13 21:27:56 +02:00
|
|
|
|
2011-09-09 21:21:37 +02:00
|
|
|
app.register_blueprint(main)
|
2011-09-11 22:11:36 +02:00
|
|
|
app.register_blueprint(api)
|
2011-09-09 21:21:37 +02:00
|
|
|
|
2011-09-11 23:00:32 +02:00
|
|
|
|
2011-09-09 21:21:37 +02:00
|
|
|
# db
|
|
|
|
db.init_app(app)
|
|
|
|
db.app = app
|
|
|
|
db.create_all()
|
|
|
|
|
|
|
|
# mail
|
|
|
|
mail.init_app(app)
|
|
|
|
|
|
|
|
def main():
|
|
|
|
app.run(host="0.0.0.0", debug=True)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|