|
|
@ -36,10 +36,6 @@ from flask_principal import Principal
|
|
|
|
from . import config_sql, logger, cache_buster, cli, ub, db
|
|
|
|
from . import config_sql, logger, cache_buster, cli, ub, db
|
|
|
|
from .reverseproxy import ReverseProxied
|
|
|
|
from .reverseproxy import ReverseProxied
|
|
|
|
from .server import WebServer
|
|
|
|
from .server import WebServer
|
|
|
|
try:
|
|
|
|
|
|
|
|
from werkzeug.middleware.proxy_fix import ProxyFix
|
|
|
|
|
|
|
|
except ImportError:
|
|
|
|
|
|
|
|
from werkzeug.contrib.fixers import ProxyFix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mimetypes.init()
|
|
|
|
mimetypes.init()
|
|
|
|
mimetypes.add_type('application/xhtml+xml', '.xhtml')
|
|
|
|
mimetypes.add_type('application/xhtml+xml', '.xhtml')
|
|
|
@ -80,10 +76,7 @@ log = logger.create()
|
|
|
|
from . import services
|
|
|
|
from . import services
|
|
|
|
|
|
|
|
|
|
|
|
def create_app():
|
|
|
|
def create_app():
|
|
|
|
try:
|
|
|
|
app.wsgi_app = ReverseProxied(app.wsgi_app)
|
|
|
|
app.wsgi_app = ReverseProxied(ProxyFix(app.wsgi_app, x_for=1, x_host=1))
|
|
|
|
|
|
|
|
except (ValueError, TypeError):
|
|
|
|
|
|
|
|
app.wsgi_app = ReverseProxied(ProxyFix(app.wsgi_app))
|
|
|
|
|
|
|
|
# For python2 convert path to unicode
|
|
|
|
# For python2 convert path to unicode
|
|
|
|
if sys.version_info < (3, 0):
|
|
|
|
if sys.version_info < (3, 0):
|
|
|
|
app.static_folder = app.static_folder.decode('utf-8')
|
|
|
|
app.static_folder = app.static_folder.decode('utf-8')
|
|
|
|