Opened 7 years ago

Closed 7 years ago

#27861 closed Cleanup/optimization (needsinfo)

Allow project template's BASE_DIR calculation to work regardless of how settings are structured

Reported by: Kimi-Arthur Owned by: nobody
Component: Core (Other) Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (2)

comment:1 by Aymeric Augustin, 7 years ago

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?

comment:2 by Tim Graham, 7 years ago

Component: UncategorizedCore (Other)
Resolution: needsinfo
Status: newclosed
Summary: 'BASE_DIR' calculation is not reliableAllow project template's BASE_DIR calculation to work regardless of how settings are structured
Type: BugCleanup/optimization

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

Note: See TracTickets for help on using tickets.
Back to Top