2017-10-19 16 views
1

예. 새 사용자 지정 암호 해더를 가져올 수 없으며 그 이유를 아직 알 수 없습니다.파이썬 커스텀 패스 해더 오류

오류 :

ImportError at /admin/ 

No module named 'honeywordHasher.hashers.MyHoneywordHasherdjango'; 'honeywordHasher.hashers' is not a package 

난 이미 INSTALLED_APPS에 honeywordHasher를 설치했고, 나는 honeywordHasher 파일 내부의 초기화 평가 있습니다.

디렉토리 :

C:. 
├───checkout 
│ ├───migrations 
│ │ └───__pycache__ 
│ ├───templates 
│ └───__pycache__ 
├───contact 
│ ├───migrations 
│ │ └───__pycache__ 
│ ├───templates 
│ └───__pycache__ 
├───custom_user 
│ ├───migrations 
│ │ └───__pycache__ 
│ └───__pycache__ 
├───honeywordHasher 
│ ├───migrations 
│ │ └───__pycache__ 
│ └───__pycache__ 
├───profiles 
│ ├───migrations 
│ │ └───__pycache__ 
│ ├───templates 
│ │ └───accounts 
│ └───__pycache__ 
├───register 
│ ├───migrations 
│ ├───templates 
│ │ └───accounts 
│ └───__pycache__ 
├───sqlite 
├───tryFOUR 
│ └───__pycache__ 
└───__pycache__ 

settings.py :

PASSWORD_HASHERS = [ 
    'honeywordHasher.hashers.MyHoneywordHasher' 
    'django.contrib.auth.hashers.PBKDF2PasswordHasher', 
    'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher', 
    'django.contrib.auth.hashers.Argon2PasswordHasher', 
    'django.contrib.auth.hashers.BCryptSHA256PasswordHasher', 
    'django.contrib.auth.hashers.BCryptPasswordHasher', 
] 

이미 honeywordgen.py에 hashers.py 또한 honeyword 세대를 만들 수 있습니다. 나는 아직도이 오류가 발생합니다. 누군가 나를 도울 수 있습니까?

답변

2

사용자 정의 해더 이후에 쉼표를 놓치 셨습니다. 그것은해야한다 : 쉼표없이

'honeywordHasher.hashers.MyHoneywordHasher', 

, 파이썬 concatenates 가져 오기 오류가 발생 'honeywordHasher.hashers.MyHoneywordHasherdjango.contrib.auth.hashers.PBKDF2PasswordHasher'을 형성하기 위해 다음 줄에 하나와 문자열.