Opened 13 years ago
Closed 13 years ago
#17920 closed Bug (fixed)
Templates with startproject or startapp do not render project_directory or app_directory correctly
Reported by: | Owned by: | Jannis Leidel | |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Release blocker | Keywords: | startproject startapp templates |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The documentation at https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-startproject states that template files may contain the tag project_directory
that should contain the full path of the newly created project. Similarly with startapp
and app_directory
.
This is not exactly true in case you are specifying the destination directory yourself. The project_directory
variable gets exactly the value specified as the parameter and in case of relative paths (or even ".") it is not *a full path* of the newly created project.
Either the documentation should be changed (although the behavour is then inconsistent) or a full path resolving functionality implemented. Maybe it could also be implemented as a full path relative to a virtualenv or other environment it is contained in.
Change History (4)
comment:1 by , 13 years ago
Owner: | changed from | to
---|---|
Triage Stage: | Unreviewed → Accepted |
Version: | 1.4-beta-1 → SVN |
comment:2 by , 13 years ago
Has patch: | set |
---|
comment:3 by , 13 years ago
Owner: | changed from | to
---|---|
Severity: | Normal → Release blocker |
https://github.com/django/django/pull/127
In addition to fixing this issue with the path the patch also:
tests other context variables
adds a clearer error if the target does not exist, currently this results in an IOError when trying to read the render a file out to non-existant location
I'm not sure though whether the target shouldn't just be created if it doesn't exist?