Opened 14 years ago
Closed 14 years ago
#17327 closed New feature (fixed)
contrib.auth management commands ignores --database option
| Reported by: | Owned by: | Brian Riley | |
|---|---|---|---|
| Component: | contrib.auth | Version: | 1.3 |
| Severity: | Release blocker | Keywords: | django db models createsuperuser management |
| Cc: | 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
I am using multiple database support with a database router to switch the current database to provide different data based on the current request. I need also to separate user tables for each db and create a superuser for it, but createsuperuser management command ignores the "--database" option that I use often with "syncdb" and migration tools such as South:
$ python manage.py createsuperuser --database="test_database" Usage: manage.py createsuperuser [options] Used to create a superuser. manage.py: error: no such option: --database
Attachments (3)
Change History (13)
comment:1 by , 14 years ago
| Component: | Core (Management commands) → contrib.auth |
|---|---|
| Summary: | createsuperuser management command ignores --database option → contrib.auth management commands ignores --database option |
| Triage Stage: | Unreviewed → Accepted |
| Type: | Uncategorized → New feature |
comment:2 by , 14 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
by , 14 years ago
| Attachment: | createsuperuser-database-option.diff added |
|---|
comment:3 by , 14 years ago
| Has patch: | set |
|---|
by , 14 years ago
| Attachment: | auth-management-commands-database-option.diff added |
|---|
comment:4 by , 14 years ago
did you note that I changed the summary - it would seem beneficial to fix this for both of the auth management commands - including changepassword
However this patch is still good - would you be willing to expand?
comment:5 by , 14 years ago
I did notice the summary change. The second patch I uploaded covers both createsuperuser and changepassword. The first patch can be ignored.
comment:6 by , 14 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
by , 14 years ago
| Attachment: | createsuperuser-multidb-tests-moved.diff added |
|---|
Moves multi DB tests for createsuperuser to regressiontests
comment:8 by , 14 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
Seems like most multi DB management commands are in regressiontests, so I moved the createsuperuser tests there. This will ensure that they aren't run when you run the tests on your Django project.
comment:9 by , 14 years ago
| Severity: | Normal → Release blocker |
|---|
Patch to add --database option to both createsuperuser and change password management commands