Opened 16 years ago
Closed 13 years ago
#8329 closed New feature (fixed)
django shouldn't delete the startproject command
Reported by: | IanHolsman | Owned by: | |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
but put a warning in it's place
Attachments (2)
Change History (13)
by , 16 years ago
Attachment: | startproj.diff added |
---|
comment:1 by , 16 years ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
No problem with the idea here, but there is a problem with the implementation. Using this approach, startproject will appear on the list of valid commands when you run django-admin.py help
.
Also, as a matter of style, I would also be temped to refactor InvalidStartProjectContextCommand into a more generic DisabledCommand that can be configured with a generic message explaining why a command has been disabled. We only have one disabled command right now, but I can see that it could be useful in other circumstances.
Tests integrated with admin_scripts would also be desirable.
comment:2 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 16 years ago
milestone: | 1.0 → post-1.0 |
---|
comment:5 by , 16 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:6 by , 16 years ago
Another (granted, small) problem with this patch: the error message is a bit awkward. I'd rephrase it like this --
The "startproject" command is disabled, because you've already defined a project. To create a new project, unset your DJANGO_SETTINGS_MODULE environment variable.
by , 14 years ago
Attachment: | startproject_disabled_warning.patch added |
---|
Patch to display warning when "startproject" subcommand is disabled because of DJANGO_SETTINGS_MODULE
comment:8 by , 14 years ago
My patch takes a bit of a different approach from Ian's. With it, "startproject" is not displayed as an available subcommand (like the current behavior), but a warning is printed.
Ian's patch is interesting. I hadn't seen it before I created my own. I can't decide whether I like his (ideally with the changes suggested by Adrian and Russell) or mine better.
I know I don't like silently removing the command.
comment:9 by , 13 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:10 by , 13 years ago
Easy pickings: | unset |
---|---|
UI/UX: | unset |
Any comments on my patch (or Ian's)? If it needs some tweaks, let me know.
patch to add a warning