Skip to content

Instantly share code, notes, and snippets.

@guillaumepiot
Last active December 15, 2015 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guillaumepiot/5338169 to your computer and use it in GitHub Desktop.
Save guillaumepiot/5338169 to your computer and use it in GitHub Desktop.
DJANGO - Default context processor for Cotidia CMS
import os
from django.contrib.sites.shortcuts import get_current_site
from django.conf import settings
def website_settings(request):
site = get_current_site(request)
data = {
'SITE_NAME': site.name,
'SITE_DOMAIN': site.domain,
'AUTHOR': settings.AUTHOR,
'AUTHOR_URL': settings.AUTHOR_URL,
'MULTILINGUAL': settings.PREFIX_DEFAULT_LOCALE,
}
return data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment