Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
allgo
allgo
Commits
adee89f5
Commit
adee89f5
authored
Sep 27, 2018
by
BAIRE Anthony
Browse files
add a global template context
parent
b723427a
Changes
2
Hide whitespace changes
Inline
Side-by-side
django/allgo/main/context_processors.py
0 → 100644
View file @
adee89f5
import
types
from
config.settings
import
parse_bool
import
config.env
GLOBAL_CONTEXT
=
types
.
MappingProxyType
({
})
def
global_context
(
request
):
"""This global context is imported in every rendered template"""
return
GLOBAL_CONTEXT
django/config/settings.py
View file @
adee89f5
...
...
@@ -220,6 +220,7 @@ TEMPLATES = [
'django.template.context_processors.static'
,
'django.template.context_processors.tz'
,
'django.contrib.messages.context_processors.messages'
,
'main.context_processors.global_context'
,
],
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment