1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
theorangeone.net-legacy/project/common/context.py

25 lines
538 B
Python
Raw Normal View History

from django.conf import settings
2016-12-28 21:38:31 +00:00
from .models import SocialMediaSettings
SETTINGS_KEYS = [
'SITE_URL',
'BASE_URL',
'STATIC_URL',
'MEDIA_URL',
'LANGUAGE_CODE',
'TIME_ZONE',
2016-11-24 22:02:27 +00:00
'ALLOWED_HOSTS',
'WAGTAIL_SITE_NAME'
]
2016-12-28 21:38:31 +00:00
def settings_injector(request):
django_settings = {}
for setting in SETTINGS_KEYS:
2016-12-28 21:38:31 +00:00
django_settings[setting] = getattr(settings, setting)
django_settings.update({
'social': SocialMediaSettings.for_site(request.site)
})
return {'settings': django_settings}