I have email template: Activate: {{ site }}/accounts/activate/{{ activation_key }}/
I want to set {{site}} to localhost. How can I do this without django-admin panel. I want to use CONSTANT for this.
I have email template: Activate: {{ site }}/accounts/activate/{{ activation_key }}/
I want to set {{site}} to localhost. How can I do this without django-admin panel. I want to use CONSTANT for this.
From the django docs: https://docs.djangoproject.com/en/dev/ref/contrib/sites/
from django.contrib.sites.shortcuts import get_current_site
def my_view(request):
current_site = get_current_site(request)
if current_site.domain == 'foo.com':
# Do something
pass
else:
# Do something else.
pass
The site information can be passed to your template