summaryrefslogtreecommitdiff
path: root/fbin/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'fbin/__init__.py')
-rw-r--r--fbin/__init__.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/fbin/__init__.py b/fbin/__init__.py
index 4bc2ef3..f36d74b 100644
--- a/fbin/__init__.py
+++ b/fbin/__init__.py
@@ -7,14 +7,14 @@ app.config.from_pyfile('fbin.cfg')
# Set up some custom converters. These are needed for file URLs to be properly parsed.
+
class HashConverter(BaseConverter):
regex = r'\w+'
+
class ExtensionConverter(BaseConverter):
regex = r'\.\w+'
-app.url_map.converters['hash'] = HashConverter
-app.url_map.converters['ext'] = ExtensionConverter
@app.context_processor
def context_processors():
@@ -29,11 +29,15 @@ def context_processors():
'nav_html': nav_html,
}
+
+app.url_map.converters['hash'] = HashConverter
+app.url_map.converters['ext'] = ExtensionConverter
+
with app.app_context():
from .fbin import app as fbin, db
from .api import app as api
from .login import login_manager
app.register_blueprint(fbin)
- app.register_blueprint(api, url_prefix = '/api')
+ app.register_blueprint(api, url_prefix='/api')
login_manager.init_app(app)
db.init_app(app)