﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13190	Empty settings.AUTHENTICATION_BACKENDS creates hard to trace problem	joel3000	Gabriel Hurley	"This is an obscure problem. If in settings.py the AUTHENTICATION_BACKENDS list is empty (i.e. AUTHENTICATION_BACKENDS=()),
then there will be no backends available to authenticate as it will override the django default behavior of using the default auth code.

When this occurs the auth login screen will just return a generic error about invalid username and password that is a pain to trace.

Unfortunately, I don't have time to figure out how to  submit this change by the procedure but here is what I suggest to fix it.

In django/contrib/auth/__init.py__ , add this check to get_backends():


{{{
def get_backends():
    from django.conf import settings
    backends = []
    for backend_path in settings.AUTHENTICATION_BACKENDS:
        backends.append(load_backend(backend_path))
 #### new code start####    
  if len(backends)==0:
        raise ImproperlyConfigured, 'settings.AUTHENTICATION_BACKENDS is empty.'
   #### new code end ##### 
return backends

}}}



It's an obscure problem, but it does seem to violate the ""no magic"" rule for django, and it tripped me up for a day
having to hunt it down. 
"		closed	contrib.auth	1.1		fixed	easy-pickings AUTHENTICATION_BACKENDS		Ready for checkin	1	0	0	0	0	0
