adds template config variables (like app title)
This commit is contained in:
@@ -42,4 +42,9 @@ def create_app():
|
|||||||
register_api(app)
|
register_api(app)
|
||||||
register_filters(app)
|
register_filters(app)
|
||||||
|
|
||||||
|
@app.context_processor
|
||||||
|
def inject_main_config():
|
||||||
|
main_config = app.config.get('MAIN', {})
|
||||||
|
return dict(main_config=main_config)
|
||||||
|
|
||||||
return app
|
return app
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<nav class="navbar navbar-nav navbar-expand-md bg-primary">
|
<nav class="navbar navbar-nav navbar-expand-md bg-primary">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand" href="/">Torn User Activity Scraper</a>
|
<a class="navbar-brand" href="/">{{ main_config.APP_TITLE }}</a>
|
||||||
{% from 'bootstrap4/nav.html' import render_nav_item %}
|
{% from 'bootstrap4/nav.html' import render_nav_item %}
|
||||||
{{ render_nav_item('views.analyze', 'Data Visualization') }}
|
{{ render_nav_item('views.analyze', 'Data Visualization') }}
|
||||||
{{ render_nav_item('download_results', 'Files') }}
|
{{ render_nav_item('download_results', 'Files') }}
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
; All main config options will be passed to template engine
|
||||||
|
[MAIN]
|
||||||
|
APP_TITLE = 'Torn User Activity Grabber'
|
||||||
|
|
||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
SECRET_KEY = your_secret_key
|
SECRET_KEY = your_secret_key
|
||||||
API_KEY = your_api_key
|
API_KEY = your_api_key
|
||||||
|
|||||||
Reference in New Issue
Block a user