#9751: project_directory calculated incorrectly when "settings" is a directory
(breaks 'startapp')
--------------------------------------+-------------------------------------
Reporter: lamby | Owner: nobody
Status: new | Milestone:
Component: Uncategorized | Version: 1.0
Keywords: startapp,settings,module | Stage: Unreviewed
Has_patch: 1 |
--------------------------------------+-------------------------------------
When a Django project's settings is contained in directory-style module
instead of the usual "`settings.py`" file-based module,
`project_directory` (as returned from setup_environ) is calculated
incorrectly as "`settings`", which results in--at least--'`startapp`'
creating new apps inside the settings directory.
Whilst the use of a settings directory is non-standard, it helps when
splitting larger or more complicated configurations, such as when settings
change depending on the hostname, etc. Indeed, this would be completely
transparent to Django if it wasn't parsing the `__file__` attribute.
To reproduce:
{{{
% django-admin.py startproject myproject
% cd myproject
% mkdir settings
% mv settings.py settings/__init__.py
% ./manage.py startapp myapp
% tree
|-- __init__.py
|-- manage.py
|-- settings
| |-- __init__.py
| `-- myapp # <----
| |-- __init__.py
| |-- models.py
| `-- views.py
`-- urls.py
Patch attached.
--
Ticket URL: <http://code.djangoproject.com/ticket/9751>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---