rvanlaar/djangorecipe — Issue #9: Buildout settings option does not propagate to django instance
Author: rvanlaar
Created: 2011-12-27 21:40:12+00:00
State: open
Labels: Invalid, Undecided

I tried setting the settings option in the Django recipe. This put the value into the bin/django script, but djangorecipe.manage.main does not seem to use the value as expected. It does use it to locate the base directory of the project, but it does not actually use this config file.

ie:
in setup_environ the DJANGO_SETTINGS_MODULE environment variable is set to project_name.settings
then in execute_from_command_line DJANGO_SETTINGS_MODULE is optionally overridden using the --settings command line option
and finally down the line in vim django.conf.__init__.LazySettings DJANGO_SETTINGS_MODULE is used to load the settings file.

For my installation I added the following lines to ./bin/django, just before the djangorecipe.manage.main line:
sys.argv.append('--settings')
sys.argv.append('product.settings')

I couldn't see how to do this with zc.buildout.easy_install.scripts, otherwise I would have provided a patch.