Opened 17 years ago
Closed 16 years ago
#6654 closed (fixed)
django-admin.py startproject/startapp commands fixes
Reported by: | Ivan Illarionov | Owned by: | Ivan Illarionov |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Keywords: | startproject startapp command | |
Cc: | ivan.illarionov@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
django-admin.py startproject
command can create projects with names that conflict with existing installed Python modules. I fixed this. See attached patch. It won't allow users accidentally block existing python modules or create several projects with the same name in different places and therefore prevent potential hard-to-diagnose bugs.
Attachments (4)
Change History (12)
by , 17 years ago
Attachment: | startproject.patch added |
---|
follow-up: 2 comment:1 by , 17 years ago
This same problem was dealt at exactly that commit ([7320]) but in a slightly different way (it also checks importing a module with that name but additionally compares it against against the INVALID_PROJECT_NAMES
list. Are you saying with your patch that the INVALID_PROJECT_NAMES
test isn't necessary?. #6509 is similar but for startapp
.
follow-up: 3 comment:2 by , 17 years ago
Replying to ramiro:
This same problem was dealt at exactly that commit ([7320]) but in a slightly different way (it also checks importing a module with that name but additionally compares it against against the
INVALID_PROJECT_NAMES
list. Are you saying with your patch that theINVALID_PROJECT_NAMES
test isn't necessary?. #6509 is similar but forstartapp
.
Yes, that's why I updated it. All names in INVALID_PROJECT_NAMES will be detected by import.
comment:3 by , 17 years ago
Replying to i_i:
Replying to ramiro:
This same problem was dealt at exactly that commit ([7320]) but in a slightly different way (it also checks importing a module with that name but additionally compares it against against the
INVALID_PROJECT_NAMES
list. Are you saying with your patch that theINVALID_PROJECT_NAMES
test isn't necessary?. #6509 is similar but forstartapp
.
Yes, that's why I updated it. All names in INVALID_PROJECT_NAMES will be detected by import.
comment:4 by , 17 years ago
Comments:
- Names
django
,test
andsite
will all be imported in the try/except/else clause and generate CommandError. This makes INVALID_PROJECT_NAMES test unnecessary.
- Ticket #6789 that was committed in 7320 is a duplicate of this ticket and deals with the same problem in a less efficient way.
- The fix for #6509 is also added.
comment:5 by , 17 years ago
Owner: | changed from | to
---|
comment:6 by , 17 years ago
Keywords: | startapp added |
---|---|
Summary: | django-admin.py startproject command enhancement/fix → django-admin.py startproject/startapp commands fixes |
comment:7 by , 16 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:8 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
startproject command fix