Created
September 17, 2015 08:05
-
-
Save kezabelle/b7ad7ee8e815d0d7293f to your computer and use it in GitHub Desktop.
Just give me the damn Site when I need it mang.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.sites.shortcuts import get_current_site | |
from django.utils.functional import SimpleLazyObject | |
def current_site(request): | |
def wrapped_get_current_site(): | |
return get_current_site(request=request) | |
return { | |
'CURRENT_SITE': SimpleLazyObject(wrapped_get_current_site), | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment