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 the admin...

keith


On Wed, Sep 17, 2008 at 12:53 PM, WillF <[EMAIL PROTECTED]> wrote:

>
>
> 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 anything? (localhost vs. productionsite.com)
>
> Thanks!
> --
> View this message in context:
> http://www.nabble.com/How-do-I-get-the-domain-the-application-is-running-on--tp19536577p19536577.html
> Sent from the django-users mailing list archive at Nabble.com.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to