Add a context processor that includes current site

This commit is contained in:
Mikkel Munch Mortensen 2018-06-23 20:18:54 +02:00
parent c8ad58f086
commit 7f41634987
Signed by untrusted user: decibyte
GPG key ID: 261C257C74AA764B
2 changed files with 15 additions and 2 deletions

View file

@ -0,0 +1,10 @@
"""Context processors for the membersystem app."""
from django.contrib.sites.shortcuts import get_current_site
def current_site(request):
"""Include the current site in the context."""
return {
'site': get_current_site(request)
}

View file

@ -36,11 +36,13 @@ INSTALLED_APPS = [
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'django.contrib.sites', 'django.contrib.sites',
'membersystem',
'profiles',
'allauth', 'allauth',
'allauth.account', 'allauth.account',
'allauth.socialaccount',
'django_extensions', 'django_extensions',
'profiles',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
@ -66,6 +68,7 @@ TEMPLATES = [
'django.template.context_processors.request', 'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth', 'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages', 'django.contrib.messages.context_processors.messages',
'membersystem.context_processors.current_site',
], ],
}, },
}, },