[Django] #31151: Automatically create a database from database config settings

6 views
Skip to first unread message

Django

unread,
Jan 9, 2020, 7:57:40 AM1/9/20
to django-...@googlegroups.com
#31151: Automatically create a database from database config settings
-------------------------------------------+--------------------------
Reporter: tasawar-hussain | Owner: nobody
Type: New feature | Status: new
Component: Migrations | Version: 3.0
Severity: Normal | Keywords: Database
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+--------------------------
Coming from rails background where `rails db:create` create a new database
from `database.yml` . So script like `python manage create_database`
should be able to create a new database from database config in
`settings.py`.

--
Ticket URL: <https://code.djangoproject.com/ticket/31151>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 9, 2020, 9:08:03 AM1/9/20
to django-...@googlegroups.com
#31151: Automatically create a database from database config settings
---------------------------------+--------------------------------------
Reporter: Tasawar Hussain | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: 3.0
Severity: Normal | Resolution: wontfix

Keywords: Database | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by Carlton Gibson):

* status: new => closed
* resolution: => wontfix


Comment:

Hi. Thanks for the report.

In all but this simplest cases, the credentials in settings.py **are not**
sufficient to enable database creation too. Given that in those cases
creating the DB doesn't involved much more than a `createdb` on the
command line or a `CREATE DATABASE...;` from the DB shell, and that
creating a DB is a relatively rare event, easily scripted, it's been
considered as not worth the complication, and security implications to add
this.

Some history: #4528, https://groups.google.com/d/topic/django-
developers/gX8gJTYRGqI/discussion, https://groups.google.com/d/topic
/django-developers/5WO3oh2KTiA/discussion
(But I couldn't find an exact duplicate, somewhat amazingly)

--
Ticket URL: <https://code.djangoproject.com/ticket/31151#comment:1>

Reply all
Reply to author
Forward
0 new messages