Cannot use a settings file outside of my project package

Bug #484572 reported by Gregor Müllegger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Django Recipe
New
Undecided
Unassigned

Bug Description

I want to use the djangorecipe's manage.py wrapper and the test script in a new
created django app.

I have the following directory structure:

    src/
        app/
            __init__.py
            tests.py
    buildout.cfg
    testsettings.py

And here is the django part of my buildout.cfg:

[django]
recipe = djangorecipe
version = 1.1.1
project = app
projectegg = app
settings = testsettings
test = app
eggs =
extra-paths =
  src

Unfortunatelly djangorecipe will fail here. It will not find my settings file
correctly, because it always prepends the settings module name with the project
name which results in `app.testsettings` in this case. This not a good
behaviour and is limiting my project layout. Ofcourse i considered moving the
testsettings.py file into the app direcotry, but I think it is no good habit
for a django app to ship with its own settings file.

Just give me nice hint if I have overlooked an option that makes djangorecipe
behave the way which is needed in this case.

Revision history for this message
Jeroen Vloothuis (jvloothuis) wrote :

Thanks for your clear report. I am afraid that there currently is no work-around for this. It should be possible to introduce an option to disable the prepending of the application. A patch to make this happen would be greatly appreciated.

Revision history for this message
Gregor Müllegger (gregor-muellegger) wrote :

Here is a working patch with tests and short documentation. It introduces the
`prepend_project_name` option which can be set to 'no', 'false' or '0' to
prevent the behaviour described above.

But i'm not happy yet with the option name `prepend_project_name`. Maybe
`skip_settings_prefix` is a better name. What do you think?

You can also find my work in the branch:
lp:~gregor-muellegger/djangorecipe/skip-settings-prefix

Gregor

Revision history for this message
Jeroen Vloothuis (jvloothuis) wrote :

Perhaps calling the option `settingsprefx`. That way one could use it like:

settingsprefix = false

What do you think?

Revision history for this message
Gregor Müllegger (gregor-muellegger) wrote :

I renamed the option to `prefixsettings`. I think `settingsprefix` sounds more like an option that sets the prefix than a boolean option that disables the prefix.

Is this ok?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.