What is the correct way to import a custom backend in settings.py? I currently have the following settings.py options:
AUTHENTICATION_BACKENDS = ('apps.apployment_site.auth.CustomAuth')
where apployment_site is the application, auth is the file name, and CustomAuth is the class name.
In my opinion, I get: ImportError: a doesn't look like a module path after running the following code:
from django.contrib.auth import authenticate from apployment_site import * authenticate(username="username", password="password")
Here are my full settings.py:
"""Django settings for apployment project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """
python django django-settings django-authentication
Aloke desai
source share