1# Copyright 2013 The Distro Tracker Developers
2# See the COPYRIGHT file at the top-level directory of this distribution and
3# at https://deb.li/DTAuthors
4#
5# This file is part of Distro Tracker. It is subject to the license terms
6# in the LICENSE file found in the top-level directory of this
7# distribution and at https://deb.li/DTLicense. No part of Distro Tracker,
8# including this file, may be copied, modified, propagated, or distributed
9# except according to the terms contained in the LICENSE file.
10"""Implements Django context processors specific to Distro Tracker."""
11from django.conf import settings
13#: Defines a dictionary of all Distro Tracker extra context key/value pairs that
14#: are to be included in the
15#: :class:`RequestContext <django.template.RequestContext>`.
16DISTRO_TRACKER_EXTRAS = {
17 'DISTRO_TRACKER_VENDOR_NAME': settings.DISTRO_TRACKER_VENDOR_NAME,
18 'DISTRO_TRACKER_VENDOR_URL': getattr(settings, 'DISTRO_TRACKER_VENDOR_URL',
19 ''),
20 'DISTRO_TRACKER_CONTACT_EMAIL': settings.DISTRO_TRACKER_CONTACT_EMAIL,
21 'DISTRO_TRACKER_CONTROL_EMAIL': settings.DISTRO_TRACKER_CONTROL_EMAIL,
22 'DISTRO_TRACKER_SITE_DOMAIN': settings.DISTRO_TRACKER_FQDN,
23}
26def extras(request):
27 """
28 The context processor which includes the
29 :py:data:`DISTRO_TRACKER_EXTRAS
30 <distro_tracker.core.context_processors.DISTRO_TRACKER_EXTRAS>` in the
31 :class:`RequestContext <django.template.RequestContext>`.
32 """
33 return DISTRO_TRACKER_EXTRAS