You can use the django.contrib.sites application, which is listed in
INSTALLED_APPS by default, for this. Here's something to show how to use
it.
from django.contrib.sites.models import Site
def get_domain():
return Site.objects.get_current().domain
You just need to update the domain name in
How does one get the domain the application is running on?
I have an email template where I pass in a url , obviously the url needs to
be fully qualified. How do i make it so that I do not have to hardcode the
domain, so the application can run on different environments without
changing
2 matches
Mail list logo