views:

32

answers:

2

Ok I think I must be missing something. In settings.py I don't see the local setting for absolute url for the site. I see there is a media_url.

In django registration it references {{ site }} which is defaulting to example.com but I'm not seeing that in any settings.

If I want the dev.mysite.com and mysite.com to work independently? Should I create some local define in settings.py for this?

A: 

sites framework

Ignacio Vazquez-Abrams
+1  A: 

The site uses the sites framework. The example.com domain is defined in the database and can be changed with the Django admin.

To use 2 sites simultaneously you will have to change the SITE_ID in the settings and add the extra site in the Django Admin.

WoLpH
its not so much I want to use them simultaneously just the dev environment for testing links I guess and the production environment are differently naturally enough. Would it be right to use two different 'sites' in this scenario?
Derek Organ
It depends I suppose. There are some libraries that use the sites framework to differentiate content. The comments module for example is site specific, so you can add test comments to site 1 without them showing on site 2. But that's only an issue if you plan to share the database between the live and testing environment ofcourse. Personally I never use the sites framework at all.
WoLpH
so in the case of the django registration what would you use to replace {{ site }}
Derek Organ
Do you want the Django Registration templates to give you the production site or the development site? If you want the development site than you can either create an extra site and use the `site_id` or you can use a separate test database where the site has a different url. In my installations I usually set the `site` to the production url and don't use any other sites.
WoLpH