Hi,
I'm trying to create an init script for a project of mine (open source). In short, my users should be able to initialize a Django project from scratch with one command. The internal workflow of the command would go something like this:
* call startproject with a custom template
* call syncdb --noinput
* call collectstatic --noinput
* ...
The thing is, to call the startproject management command I need to indirectly import django settings, which are unset at that time. After that's done and the proper settings.py gets rendered to the filesystem, I was hoping to use those settings to call manage.py commands (syncdb and collectstatic obviously need a working, valid settings.py), but it would appear Django has already initialized itself into "no settings mode". I was also hoping to avoid doing this out of process.
Is there a way to make Django reread DJANGO_SETTINGS_MODULE after it has been imported? Also, it would seem django.core.management.call_command doesn't take a 'settings' keyword argument, like django-admin.py does.
Cheers,
Tin