5

I can vistit the /admin url

but went I login admin or call my login api. I got this error message

error:

ImportError at /admin/login/
m doesn't look like a module path
Request Method: POST
Request URL:    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Django Version: 1.8.17
Exception Type: ImportError
Exception Value:    
m doesn't look like a module path
Exception Location: /root/.virtualenvs/areyoutired/lib/python3.4/site-packages/django/utils/module_loading.py in import_string, line 21
Python Executable:  /usr/local/bin/uwsgi
Python Version: 3.4.3
Python Path:    
['.',
 '',
 '/root/.virtualenvs/areyoutired/lib/python3.4',
 '/root/.virtualenvs/areyoutired/lib/python3.4/plat-x86_64-linux-gnu',
 '/root/.virtualenvs/areyoutired/lib/python3.4/lib-dynload',
 '/usr/lib/python3.4',
 '/usr/lib/python3.4/plat-x86_64-linux-gnu',
 '/root/.virtualenvs/areyoutired/lib/python3.4/site-packages']
MrFrank
  • 263
  • 1
  • 2
  • 6

5 Answers5

18

the problem is

my settings

AUTHENTICATION_BACKENDS = (
    'member.backends.EmailPasswordBackend'
)

does not have "," behind 'member.backends.EmailPasswordBackend'

so i got "m doesn't look like a module path"

that's so shame on me

MrFrank
  • 263
  • 1
  • 2
  • 6
10

You haven't given enough details to know for certain, however I am going to guess that this is a problem with your AUTHENTICATION_BACKENDS setting. See Django AUTHENTICATION_BACKENDS import error for a similar problem.

Community
  • 1
  • 1
Penguin Brian
  • 1,991
  • 14
  • 25
1

put mysite.DemoRouter.DemoRouter if Demorouter is the class which is in folder mysite

Nandu Raj
  • 2,072
  • 9
  • 20
baburajan
  • 11
  • 2
0

If you have given any backend such as EMAIL_BACKEND, AUTHENTICATION_BACKENDS etc to an empty string like EMAIL_BACKEND = "" will throw this error.

Just change it to EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' or the right backend of your choice.

Here you need to provide right AUTHENTICATION_BACKENDS.

Ranju R
  • 2,407
  • 21
  • 16
0

should be described with a comma.

AUTHENTICATION_BACKENDS = ( ('django.contrib.auth.backends.ModelBackend'),)

I had the same error due to a comma miss