Opened 15 years ago
Closed 15 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)
Changed 15 years ago by
Attachment: | startproject.patch added |
---|
comment:1 follow-up: 2 Changed 15 years ago by
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
.
comment:2 follow-up: 3 Changed 15 years ago by
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 Changed 15 years ago by
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 Changed 15 years ago by
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 Changed 15 years ago by
Owner: | changed from nobody to Ivan Illarionov |
---|
comment:6 Changed 15 years ago by
Keywords: | startapp added |
---|---|
Summary: | django-admin.py startproject command enhancement/fix → django-admin.py startproject/startapp commands fixes |
comment:7 Changed 15 years ago by
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:8 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
startproject command fix