-
Notifications
You must be signed in to change notification settings - Fork 27
/
context_processors.py
35 lines (32 loc) · 1.29 KB
/
context_processors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
##
# Copyright (C) 2013 Jessica Tallon & Matt Molyneaux
#
# This file is part of Inboxen.
#
# Inboxen is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Inboxen is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Inboxen. If not, see <http://www.gnu.org/licenses/>.
##
from django.conf import settings
def reduced_settings_context(request):
"""
Introduces a reduced set of settings into the context
This allows access to settings which will often be used
by the templates but exclude sensative information to such
as the salt to prevent accidents or bugs in the rest of django
compromising us.
"""
reduced_settings = {
"SITE_NAME": settings.SITE_NAME,
"ENABLE_REGISTRATION": settings.ENABLE_REGISTRATION,
}
return {"settings": reduced_settings}