python - Module "mymodule" does not define a "MyBackend" authentication backend -


I am trying to use custom authentication backend for a Django project. The LDAP found in my backend article is based on the backend.

When I try to log in, I get a flipping error:

  "Challenge.backends" configured on Improperly / admin / module "LDAPBackend "Authentication does not define backend  

My project is called a" challenge ", a subdirectory," backend ", in which __init __. Py and LDAPBackend.py .

My settings.py is configured to use this backend in this way:

  author_backands = ('challenge.backends .LDAPBackend ',' django.contrib.auth.backends.ModelBackend ',)  

I import the module myself using python manage.py shell Enabled and then by challenge Import Backends LDAPBackend .

No longer sure what to check now because everything appears at the right place.

You are importing it incorrectly, you are importing a module instead of a class. This is the reason that the shell allows you to import it, but Dijongo complains.

You challenge.backends.LDAPBackend.LDAPBackend .

In addition to this, it is a good idea to stick with PEP 8 while naming the module, in this way you will not be confused again in this way. The module should be named in all the locks and names of spaces, underscores, etc.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -