In django the site name is set in the db using the webadmin. I think that one of the biggest advantages of pinax is the ability to configure most of the settings in files and in local_settings.py. Is it possible to update the sites table from a config in local_settings.py when the admin run syncdb?
BR: See comment below
I'm +1 on this
This is definitely an issue in terms of it is always forgotten until too late. I'd like to do this during syncdb similar to how createsuperuser works.
I have created the post_syncdb signal to update the current site's name, if not already set, from settings.SITE_NAME (similarly SITE_DOMAIN if set). The problem is where to put it. I put it into pinax.core.models, but that means that "pinax.core" has to be put into INSTALLED_APPS. Otherwise this signal works great and has been tested. Im open for suggestions as to an alternate location. Here is the signal patch http://github.com/justquick/pinax/commit/59dc4472875c5425d27866621a9234706e72b34a
Alternatively, I made a small django app that can be plugged in and play. To plug it in:
1. download it into apps/ directory or into where your project can find.
2. add, in your settings.py INSTALLED_APPS, "site_default" (the app name) at the end or after "django.contrib.sites" that it depends on.
3. Run `manage.py syncdb`
or `manage.py createdefaultsite`
Screen shot:
(pinax-dev)>manage.py createdefaultsite
Site domain name: mydomain.com
Site display name: My Site!
(pinax-dev)
It comes with a unit test.
To run unit test:
(pinax-dev)>manage.py test site_default
{site_default} is the app name.
Source code:
http://github.com/peiwei/pinax/tree/master/pinax/apps/site_default/
More Screenshot:
(pinax-dev)> manage.py syncdb
Creating table...
You just installed Django's auth system, which means you don't have any superuse
rs defined.
Would you like to create one now? (yes/no): yes
Username: administrator
E-mail address: who@who.com
Password:
Password (again):
Superuser created successfully.
Would you like to change the default site domain name? (yes/no)[default:no]: yes
Site domain name: mydomain.com
Site display name: My Site!
...
Installing index for signup_codes.SignupCode model
Installing index for signup_codes.SignupCodeResult model