I am trying to use password reset of django
I am getting the following error after I have entered email for password reset
django.urls.exceptions.NoReverseMatch: Reverse for
'password_reset_confirm' not found. 'password_reset_confirm' is not a
valid view function or pattern name.
my urls.py include
path(
"dashboard/",
include(("ami.dashboard.urls", "dashboard"), namespace="dashboard"),
),
my dashboard/urls.py is
from django.conf.urls import include, url
# from graphene_django.views import GraphQLView
# from django.contrib import admin
from django.contrib.auth import views as auth_views
from . import views as core_views
from .product.urls import urlpatterns as product_urls
urlpatterns = [
url(r'^$', core_views.index, name='index'),
url(r'^products/', include(product_urls)),
# url(r'^login/$', auth_views.login, name='login'),
url(r'^login/$', auth_views.login, {'template_name': 'dashboard/login.html'}, name='login'),
url(r'^logout/$', auth_views.logout, {'next_page': '/'}, name='logout'),
# url(r'^logout/$', auth_views.logout, name='logout'),
# url(r'^admin/', admin.site.urls),
url(r'^', include('django.contrib.auth.urls')),
url(r'^password_reset/$', auth_views.password_reset, {
'post_reset_redirect': '/dashboard/password_reset/done/'
, 'template_name': 'registration/password_reset_form.html'},
name='password_reset'),
url(r'^password_reset/done/$', auth_views.password_reset_done,
{'template_name': 'registration/password_reset_done.html'}, name='password_reset_done'),
url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
auth_views.password_reset_confirm, {'template_name': 'registration/password_reset_confirm.html'},
name='password_reset_confirm'),
url(r'^reset/done/$', auth_views.password_reset_complete,
{'template_name': 'registration/password_reset_complete.html'},
name='password_reset_complete'),
]
error Traceback:
File
"/usr/local/lib/python3.6/site-packages/django/contrib/staticfiles/handlers.py",
line 66, in call
return self.application(environ, start_response)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/wsgi.py",
line 146, in call
response = self.get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py",
line 81, in get_response
response = self._middleware_chain(request)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 37, in inner
response = response_for_exception(request, exc)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 87, in response_for_exception
response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File
"/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in
reraise
raise value
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 35, in inner
response = get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py",
line 95, in call
response = self.get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 37, in inner
response = response_for_exception(request, exc)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 87, in response_for_exception
response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File
"/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in
reraise
raise value
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 35, in inner
response = get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py",
line 95, in call
response = self.get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 37, in inner
response = response_for_exception(request, exc)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 87, in response_for_exception
response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File
"/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in
reraise
raise value
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 35, in inner
response = get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py",
line 95, in call
response = self.get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 37, in inner
response = response_for_exception(request, exc)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 87, in response_for_exception
response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File
"/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in
reraise
raise value
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 35, in inner
response = get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py",
line 95, in call
response = self.get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 37, in inner
response = response_for_exception(request, exc)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 87, in response_for_exception
response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File
"/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in
reraise
raise value
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 35, in inner
response = get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py",
line 95, in call
response = self.get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 37, in inner
response = response_for_exception(request, exc)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 87, in response_for_exception
response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File
"/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in
reraise
raise value
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 35, in inner
response = get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py",
line 95, in call
response = self.get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 37, in inner
response = response_for_exception(request, exc)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 87, in response_for_exception
response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File
"/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in
reraise
raise value
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 35, in inner
response = get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py",
line 95, in call
response = self.get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 37, in inner
response = response_for_exception(request, exc)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 87, in response_for_exception
response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File
"/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in
reraise
raise value
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 35, in inner
response = get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py",
line 95, in call
response = self.get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 37, in inner
response = response_for_exception(request, exc)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 87, in response_for_exception
response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File
"/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in
reraise
raise value
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py",
line 35, in inner
response = get_response(request)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py",
line 128, in _get_response
response = self.process_exception_by_middleware(e, request)
File
"/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py",
line 126, in _get_response
response = wrapped_callback(request, *callback_args,
**callback_kwargs)
File "/usr/local/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File
"/usr/local/lib/python3.6/site-packages/django/views/generic/base.py",
line 69, in view
return self.dispatch(request, *args, **kwargs)
File
"/usr/local/lib/python3.6/site-packages/django/utils/decorators.py",
line 62, in _wrapper
return bound_func(*args, **kwargs)
File
"/usr/local/lib/python3.6/site-packages/django/utils/decorators.py",
line 142, in _wrapped_view
response = view_func(request, *args, **kwargs)
File
"/usr/local/lib/python3.6/site-packages/django/utils/decorators.py",
line 58, in bound_func
return func.get(self, type(self))(*args2, **kwargs2)
File
"/usr/local/lib/python3.6/site-packages/django/contrib/auth/views.py",
line 407, in dispatch
return super().dispatch(*args, **kwargs)
File
"/usr/local/lib/python3.6/site-packages/django/views/generic/base.py",
line 89, in dispatch
return handler(request, *args, **kwargs)
File
"/usr/local/lib/python3.6/site-packages/django/views/generic/edit.py",
line 142, in post
return self.form_valid(form)
File
"/usr/local/lib/python3.6/site-packages/django/contrib/auth/views.py",
line 420, in form_valid
form.save(**opts)
File
"/usr/local/lib/python3.6/site-packages/django/contrib/auth/forms.py",
line 297, in save
email, html_email_template_name=html_email_template_name,
File
"/usr/local/lib/python3.6/site-packages/django/contrib/auth/forms.py",
line 244, in send_mail
body = loader.render_to_string(email_template_name, context)
File
"/usr/local/lib/python3.6/site-packages/django/template/loader.py",
line 62, in render_to_string
return template.render(context, request)
File
"/usr/local/lib/python3.6/site-packages/django/template/backends/django.py",
line 61, in render
return self.template.render(context)
File "/usr/local/lib/python3.6/site-packages/django/template/base.py",
line 175, in render
return self._render(context)
File "/usr/local/lib/python3.6/site-packages/django/test/utils.py",
line 98, in instrumented_test_render
return self.nodelist.render(context)
File "/usr/local/lib/python3.6/site-packages/django/template/base.py",
line 943, in render
bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/site-packages/django/template/base.py",
line 910, in render_annotated
return self.render(context)
File
"/usr/local/lib/python3.6/site-packages/django/template/defaulttags.py",
line 37, in render
output = self.nodelist.render(context)
File "/usr/local/lib/python3.6/site-packages/django/template/base.py",
line 943, in render
bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/site-packages/django/template/base.py",
line 910, in render_annotated
return self.render(context)
File
"/usr/local/lib/python3.6/site-packages/django/template/defaulttags.py",
line 447, in render
url = reverse(view_name, args=args, kwargs=kwargs,
current_app=current_app)
File "/usr/local/lib/python3.6/site-packages/django/urls/base.py",
line 88, in reverse
return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args,
**kwargs))
File
"/usr/local/lib/python3.6/site-packages/django/urls/resolvers.py",
line 632, in _reverse_with_prefix
You're specifying a namespace - "dashboard" for the URLs you're including:
include(("ami.dashboard.urls", "dashboard"), namespace="dashboard"),
In this situation you need to include the namespace when reversing an URL, try:
reverse('dashboard:password_reset_confirm')
And in templates you would use:
{% url 'dashboard:password_reset_confirm' %}
More information in the Django docs: Reversing namespaced URLs
Related
Every now and then I end up with a missing file after deploy a django project, and I find it one of the hardest issues to debug because I get no logging and no error email, its just dead. I have made a custom 500 error page (followed this answer). Is it possible to show the details of which static file is missing on it? With this error Django fails before rendering a 500 page.
Heres a traceback of the error:
Traceback (most recent call last):
File "/usr/lib/python3.8/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/home/user/venv/project/lib/python3.8/site-packages/django/core/handlers/wsgi.py", line 133, in __call__
response = self.get_response(request)
File "/home/user/venv/project/lib/python3.8/site-packages/django/core/handlers/base.py", line 75, in get_response
response = self._middleware_chain(request)
File "/home/user/venv/project/lib/python3.8/site-packages/django/core/handlers/exception.py", line 36, in inner
response = response_for_exception(request, exc)
File "/home/user/venv/project/lib/python3.8/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/home/user/venv/project/lib/python3.8/site-packages/django/core/handlers/exception.py", line 129, in handle_uncaught_exception
return callback(request, **param_dict)
File "/home/user/project/src/core/base/views.py", line 236, in error_500_view
response = render(request, "core.base/500.html", context=context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/shortcuts.py", line 19, in render
content = loader.render_to_string(template_name, context, request, using=using)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/loader.py", line 62, in render_to_string
return template.render(context, request)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/base.py", line 171, in render
return self._render(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/test/utils.py", line 95, in instrumented_test_render
return self.nodelist.render(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/base.py", line 936, in render
bit = node.render_annotated(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/base.py", line 903, in render_annotated
return self.render(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/loader_tags.py", line 150, in render
return compiled_parent._render(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/test/utils.py", line 95, in instrumented_test_render
return self.nodelist.render(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/base.py", line 936, in render
bit = node.render_annotated(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/template/base.py", line 903, in render_annotated
return self.render(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/templatetags/static.py", line 106, in render
url = self.url(context)
File "/home/user/venv/project/lib/python3.8/site-packages/django/templatetags/static.py", line 103, in url
return self.handle_simple(path)
File "/home/user/venv/project/lib/python3.8/site-packages/django/templatetags/static.py", line 118, in handle_simple
return staticfiles_storage.url(path)
File "/home/user/venv/project/lib/python3.8/site-packages/django/contrib/staticfiles/storage.py", line 153, in url
return self._url(self.stored_name, name, force)
File "/home/user/venv/project/lib/python3.8/site-packages/django/contrib/staticfiles/storage.py", line 132, in _url
hashed_name = hashed_name_func(*args)
File "/home/user/venv/project/lib/python3.8/site-packages/django/contrib/staticfiles/storage.py", line 423, in stored_name
raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name)
ValueError: Missing staticfiles manifest entry for 'img/pwa/browserconfig.xml'
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 141, in __call__
response = self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 75, in get_response
response = self._middleware_chain(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 36, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 37, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 94, in __call__
response = response or self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 36, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 37, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 94, in __call__
response = response or self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 36, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 37, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 94, in __call__
response = response or self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 36, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 37, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 94, in __call__
response = response or self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 36, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 37, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 94, in __call__
response = response or self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 36, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 37, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 94, in __call__
response = response or self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 36, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 37, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 94, in __call__
response = response or self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 36, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 37, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 94, in __call__
response = response or self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 36, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 37, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/debug_toolbar/middleware.py", line 92, in __call__
panel.generate_stats(request, response)
File "/usr/local/lib/python3.6/site-packages/debug_toolbar/panels/staticfiles.py", line 126, in generate_stats
"staticfiles_apps": self.get_staticfiles_apps(),
File "/usr/local/lib/python3.6/site-packages/debug_toolbar/panels/staticfiles.py", line 168, in get_staticfiles_apps
for finder in finders.get_finders():
File "/usr/local/lib/python3.6/site-packages/django/contrib/staticfiles/finders.py", line 283, in get_finders
yield get_finder(finder_path)
File "/usr/local/lib/python3.6/site-packages/django/contrib/staticfiles/finders.py", line 292, in get_finder
Finder = import_string(import_path)
File "/usr/local/lib/python3.6/site-packages/django/utils/module_loading.py", line 17, in import_string
module = import_module(module_path)
File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'django.contrib.static'
I have been trying to get to the root of this error without any luck, I believe it came up while I was doing some refactoring.
I will appreciate another set of eyes on this.
The error complains about a module it can not find:
django.contrib.static
This is likely a string in the INSTALLED_APPS setting [Django-doc]. The name of the module is however:
django.contrib.staticfiles
You thus should alter the INSTALLED_APPS, and use that string, like:
# settings.py
# …
INSTALLED_APPS = [
# …
'django.contrib.staticfiles',
# …
]
# …
Since this question showed up when i had a similar issue : I ran into an error message saying
"ModuleNotFoundError: No module named 'django.contrib.staticusers'"
My issue was that I forgot to put a comma in my INSTALLED_APPS in settings.py
Writing :
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles"
"users",
Instead of :
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles", <- comma here
"users",
I have two apps: simulation_api and building_data. Each one has templates and urls. The urls I import in my main configuration.
In my template of simulation_api I would like to set a link to my detail view of building data.
This is what I am trying (in my template of simulation_api) which throws me an error (django.urls.exceptions.NoReverseMatch):
{% for item in simulations.project.buildinggroup_set.all %}
{{ item.description }}
{% endfor%}
The for loop works, the problem is the url that I am trying to reverse.
I am reversing it like this in my models of building_data:
class BuildingGroup(models.Model):
name = models.CharField(max_length=500, null=True, blank=True)
project = models.ForeignKey(Project, on_delete=models.CASCADE)
def get_absolute_url(self):
return reverse("detail_building_group", kwargs={"id" : self.id})
I think the problem is somehow that I reverse the url in one app but it is not recognised in the template of the other app. But maybe it's also something else...
Anyone has an idea? Thanks so much in advance! Very much appreciated!
Not sure if it is useful, but here my simplified model for the simulation:
class Simulation(models.Model):
project = models.ForeignKey(Project, on_delete=models.CASCADE)
my urls of building_data
app_name = 'buildings'
urlpatterns = [
path('list/building-group/<int:id>/', DetailBuildingGroupView.as_view(), name="detail_building_group"),
]
My traceback:
django.urls.exceptions.NoReverseMatch
django.urls.exceptions.NoReverseMatch: Reverse for 'detail_building_group' not found. 'detail_building_group' is not a valid view function or pattern name.
Traceback (most recent call last)
File "/usr/local/lib/python3.6/site-packages/django/contrib/staticfiles/handlers.py", line 66, in __call__
return self.application(environ, start_response)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 146, in __call__
response = self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 81, in get_response
response = self._middleware_chain(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
response = self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
response = self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
response = self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
response = self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
response = self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
response = self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
response = self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
response = self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/app/analytics/middleware.py", line 22, in __call__
response = self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
response = self.get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 158, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 156, in _get_response
response = response.render()
File "/usr/local/lib/python3.6/site-packages/django/template/response.py", line 106, in render
self.content = self.rendered_content
File "/usr/local/lib/python3.6/site-packages/django/template/response.py", line 83, in rendered_content
content = template.render(context, self._request)
File "/usr/local/lib/python3.6/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 175, in render
return self._render(context)
File "/usr/local/lib/python3.6/site-packages/django/test/utils.py", line 98, in instrumented_test_render
return self.nodelist.render(context)
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 943, in render
bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 910, in render_annotated
return self.render(context)
File "/usr/local/lib/python3.6/site-packages/django/template/loader_tags.py", line 155, in render
return compiled_parent._render(context)
File "/usr/local/lib/python3.6/site-packages/django/test/utils.py", line 98, in instrumented_test_render
return self.nodelist.render(context)
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 943, in render
bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 910, in render_annotated
return self.render(context)
File "/usr/local/lib/python3.6/site-packages/django/template/loader_tags.py", line 67, in render
result = block.nodelist.render(context)
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 943, in render
bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 910, in render_annotated
return self.render(context)
File "/usr/local/lib/python3.6/site-packages/django/template/defaulttags.py", line 211, in render
nodelist.append(node.render_annotated(context))
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 910, in render_annotated
return self.render(context)
File "/usr/local/lib/python3.6/site-packages/django/template/defaulttags.py", line 447, in render
url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)
File "/usr/local/lib/python3.6/site-packages/django/urls/base.py", line 90, in reverse
return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
File "/usr/local/lib/python3.6/site-packages/django/urls/resolvers.py", line 636, in _reverse_with_prefix
raise NoReverseMatch(msg)
django.urls.exceptions.NoReverseMatch: Reverse for 'detail_building_group' not found. 'detail_building_group' is not a valid view function or pattern name.
I solved it doing this:
I added a namespace to my urls in my main config.
Then I reversed it like this:
def get_absolute_url(self):
return reverse("buildings:detail_building_group", kwargs={"id": self.id})
whereas buildings is my namespace and detail_building_groupis my url-name.
Also I had to add my detail-url to my other app as well in the urls, so it recognized the url.
Thanks JPG for leading me in the right direction!
This also helped: http://cheng.logdown.com/posts/2016/01/06/django-how-to-reverse-urls-belonged-to-other-apps
I'm trying to config the django project in vscode and running via debug.
python==3.6.7
Django==2.1.8
When I try to open http://127.0.0.1:8000/admin/ I am getting the following error, please refer the screen shot below.
I tried many possible workaround from google, by trying to change logging level from debug to info, but nothing seems to be worked.
I request you to please let me know how to fix this issues.
Thanks in advance.
Error Logs:
Exception has occurred: VariableDoesNotExist
Failed lookup for key [is_popup] in [{'True': True, 'False': False, 'None': None}, {'csrf_token': <SimpleLazyObject: <function csrf.<locals>._get_val at 0x7ff6323e3510>>, 'request': <WSGIRequest: GET '/admin/login/?next=/admin/'>, 'user': <SimpleLazyObject: <django.contrib.auth.models.AnonymousUser object at 0x7ff632434dd8>>, 'perms': <django.contrib.auth.context_processors.PermWrapper object at 0x7ff6323b2f98>, 'messages': <django.contrib.messages.storage.fallback.FallbackStorage object at 0x7ff63246cc88>, 'DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10, 'INFO': 20, 'SUCCESS': 25, 'WARNING': 30, 'ERROR': 40}}, {}, {'form': <AdminAuthenticationForm bound=False, valid=Unknown, fields=(username;password)>, 'view': <django.contrib.auth.views.LoginView object at 0x7ff63246cc50>, 'site_title': 'Django site admin', 'site_header': 'Django administration', 'site_url': '/', 'has_permission': False, 'available_apps': [], 'title': 'Log in', 'app_path': '/admin/login/?next=/admin/', 'username': '', 'next': '/admin/', 'site': <django.contrib.sites.requests.RequestSite object at 0x7ff6323f95f8>, 'site_name': '127.0.0.1:8000', 'LANGUAGE_CODE': 'en-us', 'LANGUAGE_BIDI': False}]
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/base.py", line 850, in _resolve_lookup
(bit, current)) # missing attribute
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/base.py", line 796, in resolve
value = self._resolve_lookup(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/base.py", line 671, in resolve
obj = self.var.resolve(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/defaulttags.py", line 875, in eval
return self.value.resolve(context, ignore_failures=True)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/defaulttags.py", line 302, in render
match = condition.eval(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated
return self.render(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/base.py", line 937, in render
bit = node.render_annotated(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/base.py", line 163, in _render
return self.nodelist.render(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/loader_tags.py", line 150, in render
return compiled_parent._render(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated
return self.render(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/base.py", line 937, in render
bit = node.render_annotated(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/base.py", line 163, in _render
return self.nodelist.render(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/loader_tags.py", line 150, in render
return compiled_parent._render(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated
return self.render(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/base.py", line 937, in render
bit = node.render_annotated(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/base.py", line 163, in _render
return self.nodelist.render(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/base.py", line 171, in render
return self._render(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/response.py", line 83, in rendered_content
content = template.render(context, self._request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/template/response.py", line 106, in render
self.content = self.rendered_content
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 154, in _get_response
response = response.render()
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/utils/deprecation.py", line 91, in __call__
response = response or self.get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/utils/deprecation.py", line 91, in __call__
response = response or self.get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/utils/deprecation.py", line 91, in __call__
response = response or self.get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/utils/deprecation.py", line 91, in __call__
response = response or self.get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/utils/deprecation.py", line 91, in __call__
response = response or self.get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/utils/deprecation.py", line 91, in __call__
response = response or self.get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/utils/deprecation.py", line 91, in __call__
response = response or self.get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 78, in get_response
response = self._middleware_chain(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 142, in __call__
response = self.get_response(request)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/contrib/staticfiles/handlers.py", line 65, in __call__
return self.application(environ, start_response)
File "/usr/lib/python3.6/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/servers/basehttp.py", line 194, in handle_one_request
handler.run(self.server.get_app())
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/servers/basehttp.py", line 169, in handle
self.handle_one_request()
File "/usr/lib/python3.6/socketserver.py", line 721, in __init__
self.handle()
File "/usr/lib/python3.6/socketserver.py", line 361, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.6/socketserver.py", line 348, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.6/socketserver.py", line 317, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.6/socketserver.py", line 238, in serve_forever
self._handle_request_noblock()
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/servers/basehttp.py", line 213, in run
httpd.serve_forever()
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 139, in inner_run
ipv6=self.use_ipv6, threading=threading, server_cls=self.server_cls)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 104, in run
self.inner_run(None, **options)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 95, in handle
self.run(**options)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/management/base.py", line 353, in execute
output = self.handle(*args, **options)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 60, in execute
super().execute(*args, **options)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/fs052/Desktop/workspace/tryouts/dj2/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/home/fs052/Desktop/workspace/tryouts/dj2/dj2/manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/lib/python3.6/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
Seems your django installation is corrupt. Try this
pip install -I django
I have a model/class like this:
class MyModel(TimeStampedModel):
some_field = models.CharField()
#classmethod
def my_class_method(cls, value, other_value):
print(value)
However, when I do this from another view:
value = "Test"
MyModel.my_class_method(value, other_value)
I get an error: TypeError: __call__() takes 2 positional arguments but 3 were given
I feel like I am going crazy.
The model that I am doing this to has:
class Meta:
abstract = True
Edit: Full traceback (using my real function names):
Traceback (most recent call last):
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\whitenoise\base.py", line 66, in __call__
return self.application(environ, start_response)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\wsgi.py", line 146, in __call__
response = self.get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\base.py", line 81, in get_response
response = self._middleware_chain(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "C:\Users\Cole\PycharmProjects\webapp\config\wsgi.py", line 27, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 35, in inner
response = get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\deprecation.py", line 95, in __call__
response = self.get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "C:\Users\Cole\PycharmProjects\webapp\config\wsgi.py", line 27, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 35, in inner
response = get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\deprecation.py", line 95, in __call__
response = self.get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "C:\Users\Cole\PycharmProjects\webapp\config\wsgi.py", line 27, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 35, in inner
response = get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\whitenoise\middleware.py", line 25, in __call__
response = self.get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "C:\Users\Cole\PycharmProjects\webapp\config\wsgi.py", line 27, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 35, in inner
response = get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\deprecation.py", line 95, in __call__
response = self.get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "C:\Users\Cole\PycharmProjects\webapp\config\wsgi.py", line 27, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 35, in inner
response = get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\deprecation.py", line 95, in __call__
response = self.get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "C:\Users\Cole\PycharmProjects\webapp\config\wsgi.py", line 27, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 35, in inner
response = get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\deprecation.py", line 95, in __call__
response = self.get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "C:\Users\Cole\PycharmProjects\webapp\config\wsgi.py", line 27, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 35, in inner
response = get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\deprecation.py", line 95, in __call__
response = self.get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "C:\Users\Cole\PycharmProjects\webapp\config\wsgi.py", line 27, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 35, in inner
response = get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\deprecation.py", line 95, in __call__
response = self.get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "C:\Users\Cole\PycharmProjects\webapp\config\wsgi.py", line 27, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 35, in inner
response = get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\deprecation.py", line 95, in __call__
response = self.get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "C:\Users\Cole\PycharmProjects\webapp\config\wsgi.py", line 27, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 35, in inner
response = get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\deprecation.py", line 95, in __call__
response = self.get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "C:\Users\Cole\PycharmProjects\webapp\config\wsgi.py", line 27, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 35, in inner
response = get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\deprecation.py", line 95, in __call__
response = self.get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 37, in inner
response = response_for_exception(request, exc)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 87, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 122, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "C:\Users\Cole\PycharmProjects\webapp\config\wsgi.py", line 27, in null_technical_500_response
six.reraise(exc_type, exc_value, tb)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py", line 35, in inner
response = get_response(request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\base.py", line 128, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\Cole\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\contrib\auth\decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "C:\Users\Cole\PycharmProjects\webapp\vendor_app\apps\users\decorators.py", line 14, in wrap
return function(request, *args, **kwargs)
File "C:\Users\Cole\PycharmProjects\webapp\vendor_app\apps\core\locations\views.py", line 56, in location_detail_view
Location.create_or_update_location(form, formset)
TypeError: __call__() takes 2 positional arguments but 3 were given
The issue seems to have been caused by wrapping a classmethod also in a transaction atomic decorator:
#transaction.atomic
#classmethod
def my_function(cls, **kwargs):
... my function
Apparently this doesn't seem to work.