Move the admin interface back to a blueprint

master
kaiyou 7 years ago
parent 914427f852
commit 974c351802

@ -13,7 +13,7 @@ from apscheduler.schedulers import background
# Create application
app = flask.Flask(__name__, static_url_path='/admin/app_static')
app = flask.Flask(__name__)
default_config = {
'SQLALCHEMY_DATABASE_URI': 'sqlite:////data/main.db',
@ -82,7 +82,8 @@ def inject_user():
return dict(current_user=flask_login.current_user)
# Import views
from mailu.views import *
from mailu import ui
app.register_blueprint(ui.ui, url_prefix='/ui')
# Create the prefix middleware
class PrefixMiddleware(object):

@ -0,0 +1,6 @@
from flask import Blueprint
ui = Blueprint('ui', __name__, static_folder='static', template_folder='templates')
from mailu.ui.views import *

@ -1,4 +1,5 @@
from mailu import db, models, forms
from mailu import db, models
from mailu.ui import forms
import flask
import flask_login

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save