Closed ArtemBernatskyy closed 6 years ago
'ReverseManyToOneDescriptor' object has no attribute 'get_by_natural_key' Request Method: GET Request URL: http://172.16.0.89:8000/api/v0/lockers/ Django Version: 1.11.8 Python Executable: /var/webapps/locker_project/env/bin/python Python Version: 3.5.2 Python Path: ['/var/webapps/locker_project/code', '/var/webapps/locker_project/env/lib/python35.zip', '/var/webapps/locker_project/env/lib/python3.5', '/var/webapps/locker_project/env/lib/python3.5/plat-x86_64-linux-gnu', '/var/webapps/locker_project/env/lib/python3.5/lib-dynload', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/var/webapps/locker_project/env/lib/python3.5/site-packages'] Server time: Fri, 15 Dec 2017 12:43:02 +0000 Installed Applications: ['grappelli', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'ckeditor', 'django_cleanup', 'imagekit', 'rest_framework', 'rest_framework.authtoken', 'locker_project.accounts', 'locker_project.lockers', 'locker_project.operations'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware'] Traceback: File "/var/webapps/locker_project/env/lib/python3.5/site-packages/rest_framework/request.py" in __getattribute__ 385. return getattr(self._request, attr) During handling of the above exception ('WSGIRequest' object has no attribute 'successful_authenticator'), another exception occurred: File "/var/webapps/locker_project/env/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner 41. response = get_response(request) File "/var/webapps/locker_project/env/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "/var/webapps/locker_project/env/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/var/webapps/locker_project/env/lib/python3.5/site-packages/django/views/decorators/csrf.py" in wrapped_view 58. return view_func(*args, **kwargs) File "/var/webapps/locker_project/env/lib/python3.5/site-packages/django/views/generic/base.py" in view 68. return self.dispatch(request, *args, **kwargs) File "/var/webapps/locker_project/env/lib/python3.5/site-packages/rest_framework/views.py" in dispatch 489. response = self.handle_exception(exc) File "/var/webapps/locker_project/env/lib/python3.5/site-packages/rest_framework/views.py" in handle_exception 449. self.raise_uncaught_exception(exc) File "/var/webapps/locker_project/env/lib/python3.5/site-packages/rest_framework/views.py" in dispatch 477. self.initial(request, *args, **kwargs) File "/var/webapps/locker_project/env/lib/python3.5/site-packages/rest_framework/views.py" in initial 395. self.check_permissions(request) File "/var/webapps/locker_project/env/lib/python3.5/site-packages/rest_framework/views.py" in check_permissions 330. request, message=getattr(permission, 'message', None) File "/var/webapps/locker_project/env/lib/python3.5/site-packages/rest_framework/views.py" in permission_denied 169. if request.authenticators and not request.successful_authenticator: File "/var/webapps/locker_project/env/lib/python3.5/site-packages/rest_framework/request.py" in __getattribute__ 387. six.reraise(info[0], info[1], info[2].tb_next) File "/var/webapps/locker_project/env/lib/python3.5/site-packages/django/utils/six.py" in reraise 685. raise value.with_traceback(tb) File "/var/webapps/locker_project/env/lib/python3.5/site-packages/rest_framework/request.py" in successful_authenticator 238. self._authenticate() File "/var/webapps/locker_project/env/lib/python3.5/site-packages/rest_framework/request.py" in _authenticate 345. user_auth_tuple = authenticator.authenticate(self) File "/var/webapps/locker_project/env/lib/python3.5/site-packages/rest_framework_jwt/authentication.py" in authenticate 43. user = self.authenticate_credentials(payload) File "/var/webapps/locker_project/env/lib/python3.5/site-packages/rest_framework_jwt/authentication.py" in authenticate_credentials 59. user = User.objects.get_by_natural_key(username)```
Closing issue, it was my fault. It was caused because i've named one of my tables in models Object. Don't do that )
Object