27 lines
505 B
Python
27 lines
505 B
Python
|
# coding: utf-8
|
||
|
from flask import Flask
|
||
|
from flask.logging import default_handler
|
||
|
from flask_sqlalchemy import SQLAlchemy
|
||
|
import logging
|
||
|
import sys
|
||
|
|
||
|
from .config import Config
|
||
|
|
||
|
db = SQLAlchemy()
|
||
|
|
||
|
def create_app(config_class=Config):
|
||
|
app = Flask(__name__)
|
||
|
|
||
|
app.config.from_object(config_class)
|
||
|
|
||
|
db.init_app(app)
|
||
|
|
||
|
from apiweb.content.main import main
|
||
|
from apiweb.content.errors.handlers import errors
|
||
|
|
||
|
app.register_blueprint(main)
|
||
|
app.register_blueprint(errors)
|
||
|
|
||
|
|
||
|
return app
|