Source

genmap / context_processors.py

Full commit
# -*- coding: utf-8

from django.conf import settings
from django.contrib.sites.models import Site

def google_key(request):
    """Integrate the GOOGLE MAPS API KEY and any required variable
    into the context
    """
    key = settings.GOOGLE_MAPS_API_KEY

    return {'gmaps_key':key }


def google_analytics(request):
    """
    Integrate Google Analytics key into the request context
    """
    try:
        analytics_code = settings.GOOGLE_ANALYTICS_CODE
    except:
        analytics_code = None
    return {'google_analytics_code':analytics_code}

def community(request):
    community = settings.COMMUNITY
    community['link'] = '<a href="%s">%s</a>' % (community['website'], community['name'])
    return { 'community': community }

def this_site(request):
    return { 'this_site': Site.objects.get_current() }