From: Emilie Date: Mon, 7 Nov 2016 16:33:12 +0000 (+0100) Subject: Newsletter : url link X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=9125bf5ce796156e403b885d9d4b8c991b062141;p=mezzo.git Newsletter : url link --- diff --git a/app/organization/pages/context_processors.py b/app/organization/pages/context_processors.py new file mode 100644 index 00000000..30e41faa --- /dev/null +++ b/app/organization/pages/context_processors.py @@ -0,0 +1,6 @@ +from django.conf import settings # import the settings file +from organization.pages.models import Page + +def page_static(request): + NEWSLETTER_SUBSCRIBING_URL = Page.objects.filter(slug="newsletter").first().get_absolute_url() + return {'NEWSLETTER_SUBSCRIBING_URL': NEWSLETTER_SUBSCRIBING_URL,} diff --git a/app/settings.py b/app/settings.py index ab506770..baedfb93 100644 --- a/app/settings.py +++ b/app/settings.py @@ -272,7 +272,8 @@ TEMPLATES = [{'APP_DIRS': True, 'django.core.context_processors.tz', 'mezzanine.conf.context_processors.settings', 'mezzanine.pages.context_processors.page', - 'organization.core.context_processors.static')}}] + 'organization.core.context_processors.static', + 'organization.pages.context_processors.page_static')}}] # List of middleware classes to use. Order is important; in the request phase, # these middleware classes will be applied in the order given, and in the