[Django] #27861: 'BASE_DIR' calculation is not reliable

14 views
Skip to first unread message

Django

unread,
Feb 19, 2017, 2:55:08 AM2/19/17
to django-...@googlegroups.com
#27861: 'BASE_DIR' calculation is not reliable
-----------------------------------------+------------------------
Reporter: Kimi-Arthur | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
Hi,

The current BASE_DIR calculation is simple, just 2 levels up from the
current file, i.e. parent folder of current folder.
This is not reliable because it assumes the settings file will stay in
project_name folder, no deeper.
However, if the user has multiple settings (say for each environment), he
may be willing to create a sub package inside project_name and specify the
"DJANGO_SETTINGS_MODULE" when running the server. This will be a problem
as the BASE_DIR is actually the project_name dir instead of its parent.

--
Ticket URL: <https://code.djangoproject.com/ticket/27861>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 19, 2017, 4:11:34 PM2/19/17
to django-...@googlegroups.com
#27861: 'BASE_DIR' calculation is not reliable
-------------------------------+--------------------------------------

Reporter: Kimi-Arthur | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Aymeric Augustin):

Yes, the logic must be updated if the file is moved deeper in the source
tree.

Do you have a more robust alternative to suggest?

--
Ticket URL: <https://code.djangoproject.com/ticket/27861#comment:1>

Django

unread,
Feb 20, 2017, 9:45:28 AM2/20/17
to django-...@googlegroups.com
#27861: Allow project template's BASE_DIR calculation to work regardless of how
settings are structured
-------------------------------------+-------------------------------------
Reporter: Kimi-Arthur | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Core (Other) | Version: 1.10
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* type: Bug => Cleanup/optimization
* component: Uncategorized => Core (Other)
* resolution: => needsinfo


Comment:

It's also not clear to me that this is feasible.

--
Ticket URL: <https://code.djangoproject.com/ticket/27861#comment:2>

Reply all
Reply to author
Forward
0 new messages