google app engine - How to debug Django NoReverseMatch errors? -


Guys, I'm getting NoReverseMatch error for a special URL call.

I want to know: Are there any good tools for these debugging in general? For example, there are ways to know which URLs are registered?

My special example:

Template:

  & lt; A href = "{% Url django.contrib.auth.views.redirect_to_login blarg%}" & gt; Sign in & lt; / A & gt;  

Error:

  NoReverseMatch: 'settings.django.contrib.auth.views.redirect_to_login' for argument with '(' [[[Inappropriate step ]], And the keyword logic '{}' not found  

I am using Google App Engine with AppNipPatch, so Django itself has been modified.

In this special case where the URL uses the full path of the inverted view function, the easy job is just Look at the viewing function. In Django-1.1 it looks:

  def redirect_to_login (Next, login_url = none, redirect_field_name = REDIRECT_FIELD_NAME): "The user redirects to the login page, given the 'next' page "Login_arial: login_link = settings.login_interview.login_interview.php?good_interview=HttpResponseRedirect ('% s?% S =% s'% (login_url, urlquote (redirect_field_name), urlquite (next))  

Returns this function even if a request does not take an object, so it is not actually a proper view, and it is django / Contrib / auth / urls.py . This means that it is probably meant to use only in other views as an auxiliary function.

In any case, depending on your particular example, what you probably wanted to do was to use such a plain old login URL:

  & lt; A href = "{% url django.contrib.auth.views.login%}? Next = {{request.path}}" & gt; Login & lt; / A & gt; Besides, I believe that if you set  TEMPLATE_DEBUG = true  in your settings, before you throw the error, you have to delete all the URLs of the DNS Will be investigated. 


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -