According to docs, you shouldn't add secretballot.middleware.SecretBallotMiddleware
middleware.
Choose from SecretBallotIpMiddleware
or SecretBallotIpUseragentMiddleware
.
Вопрос
When adding 'secretballot.middleware.SecretBallotMiddleware'
to MIDDLEWARE_CLASSES
I keep getting the following error:
Exception Type: NotImplementedError
Exception Location: .../django_secretballot-0.2.3-py2.7.egg/secretballot/middleware.py in generate_token, line 11
Any ideas why? Thanks in advance for the help!
Решение 2
According to docs, you shouldn't add secretballot.middleware.SecretBallotMiddleware
middleware.
Choose from SecretBallotIpMiddleware
or SecretBallotIpUseragentMiddleware
.
Другие советы
The reason of this error is that SecretBallotMiddleware is actually an abstract class (source) you need to subclass it or use already implemented SecretBallotIpMiddleware. See documentation section MIDDLEWARE for details.