2

I'm moving my site from Django 1.5.x to Django 1.6.0, and I noted this in the release notes:

[..] The admin is now enabled by default in new projects; the sites framework no longer is. [..]

How to set the default domain (instead of www.example.com) without the Django sites framework?

Are any sites related settings now made redundant redundant by this change?

Simeon Visser
  • 118,920
  • 18
  • 185
  • 180
Joseph Victor Zammit
  • 14,760
  • 10
  • 76
  • 102

1 Answers1

3

Two options:

  • Define the domain name as a constant in your settings and use it where needed in your code. If you have only one site this is a reasonable decision as you no longer need the whole sites framework.
  • Enable the sites framework again and define one Site object with www.example.com as domain. You'll also need to specify the site's id as SITE_ID in your Django settings.
Simeon Visser
  • 118,920
  • 18
  • 185
  • 180
  • Nice answer.. I would go with option 2, as `Sites` could be handy in multiple ways. – karthikr Nov 13 '13 at 14:59
  • 1
    Oh ok, I assumed that Django would provide some setting itself... but doesn't make much difference to define it myself in the settings. @karthikr I will go for option 2 since it's an already running website with the `sites` framework in place. – Joseph Victor Zammit Nov 13 '13 at 15:03