forked from data.coop/membersystem
Add a context processor that includes current site
This commit is contained in:
parent
c8ad58f086
commit
7f41634987
10
membersystem/context_processors.py
Normal file
10
membersystem/context_processors.py
Normal 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)
|
||||||
|
}
|
|
@ -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',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue