dr.botzo/dr_botzo/dr_botzo/context_processors.py
Brian S. Stephan 5225d2bd6b add django-registration-redux and use some of it
for the moment this is for the password change url used in the auth
dropdown, and a better login page, but this might become other stuff
eventually too. the signup page exists and is linked to, even if i don't
have a great reason for this to exist

bunch of templates added now to support the intentional and
unintentional stuff
2016-03-30 15:36:56 -05:00

15 lines
455 B
Python

"""Site processors to add additional template tags and whatnot."""
from django.contrib.sites.shortcuts import get_current_site
from django.utils.functional import SimpleLazyObject
def site(request):
site = SimpleLazyObject(lambda: get_current_site(request))
protocol = 'https' if request.is_secure() else 'http'
return {
'site': site,
'site_root': SimpleLazyObject(lambda: "{0}://{1}".format(protocol, site.domain)),
}