You seem to be missing the point of the code you reference above. You should probably read up on the "Sites" framework that ships with Django:
http://docs.djangoproject.com/en/dev/ref/contrib/sites/ All the best, - Gabriel On Mar 12, 1:39 pm, aditya <bluemangrou...@gmail.com> wrote: > Description > ========= > This page of the Django documentation shows how to use the 'Sites' > framework to get the domain of the current site: > > http://docs.djangoproject.com/en/dev/ref/contrib/sites/ > > I've noticed that 'domain = Site.objects.get_current().domain' is > becoming a common idiom in Django. Most recently I've seen it being > used in django-disqus as a way to get the url of the current site > (Disqus tracks comments by associating each comment with a specific > url). I'm also seeing it being used for RSS feeds and for mailers. > > The trouble is, there is no straightforward way to configure the name > and domain of a site. > Currently, Django uses "example.com" for both the domain and the > name. The only way to change that is to wade into the actual > database. I'd like to propose adding two optional variables to > settings.py: > > SITE_DOMAIN and > SITE_NAME. > > If either of these are defined, they will override "example.com" when > the new site is created. > > Implementation > ============ > > This is quite easy to implement. In the create_default_site function, > add these 5 lines: > > from django.conf import settings > try: def_domain = settings.SITE_DOMAIN > except: def_domain = "example.com" > try: def_name = settings.SITE_NAME > except: def_name = "example.com" > > and then create the new site using: > s = Site(domain=def_domain, name=def_name) > > I hope this is the correct place to post this! I wanted to hear what > other people thought of this proposal. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.