mirror of https://github.com/IoTcat/PyOne.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
628 B
26 lines
628 B
#-*- coding=utf-8 -*- |
|
from flask import Flask |
|
from werkzeug.contrib.fixers import ProxyFix |
|
from config import config |
|
from .extend import * |
|
from utils.header import GetConfig |
|
|
|
|
|
|
|
def create_app(): |
|
app = Flask(__name__) |
|
app.config.from_object(config) |
|
config.init_app(app) |
|
app.wsgi_app = ProxyFix(app.wsgi_app) |
|
cache.init_app(app) |
|
limiter.init_app(app) |
|
|
|
from .front import front as front_blueprint |
|
app.register_blueprint(front_blueprint) |
|
|
|
from .admin import admin as admin_blueprint |
|
app.register_blueprint(admin_blueprint,url_prefix='/{}'.format(GetConfig('admin_prefix'))) |
|
|
|
return app |
|
|
|
|
|
|