With recent bug reports (#24332 
<https://code.djangoproject.com/ticket/24332>, #24298 
<https://code.djangoproject.com/ticket/24298> and now #24394 
<https://code.djangoproject.com/ticket/24394>) all caused by setting 
`DATABASES['default'] = {}`, this makes me wonder if it should be supported 
at all.
The documentation states:

> <https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-DATABASES> 
> setting 
> must configure a default database; any number of additional databases may 
> also be specified.[1] 

And indeed, if default is not set at all, an error is raised. If default 
does not provide valid database settings, it is set to use 
`django.db.backends.dummy`. This will raise a `NotImplementedError` as soon 
as it is used, but it seems you can work around this quite well and ensure 
that `default` is barely used. The exceptions to this are reported in the 
mentioned bug reports, most notably `manage.py test` uses the `default` 

Should the documentation be clarified that it not only requires `default` 
to be set, but that it requires a valid database configuration as well? Or 
should an empty `default` configuration be valid?

In #24332 and #24398, both fixed now, there was the additional issue that 
the code was simply not using the database is was supposed to use.

I think this mostly boils down to whether we want the `test` command to 
support an explicit non-default database, you should be able to manipulate 
all other code to only use non-default databases, save some similar bugs 
that might still be present. This would reduce `default` to simple 
semantics and would probably warrant that it is no longer required if you 
supply an otherwise valid database configuration. However, I don't see any 
drawbacks to requiring a valid database setup. At most this would require 
developers to copy the credentials from the database they are actually 
using to the `default` setting, but it would also be an incentive to 
actually use `default` as the default database. 

[1]  https://docs.djangoproject.com/en/dev/ref/settings/#databases

You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to