Need a hint on what this error is

I have a rather strange problem in the sense that I don't understand what it might be. My site is using django-registration and everything works fine, but if I restart django dev. the server is in the middle of the session (i.e. logged in). I immediately get the error:

Outlined a render exception: The inverse for django.contrib.auth.decorators._CheckLogin object at 0x235aa50 with arguments '()' and keyword arguments '{}' not found.

Once again: everything works fine unless I restart dev. server. This error occurs if and only when I restart djange dev. the server was registered on my site.

0


a source to share


1 answer


The Django URL reverse function is unfortunately very fragile. It works by importing all views and seeing which ones match. If, for some reason, it cannot import the view - any view attached to the URLconf - then the complete reverse match fails.

So, sometimes there are some dependencies in your views which means they cannot be imported immediately after a server restart. This causes all reverse URL matches to fail, even those that have nothing to do with the view with the problem. But if you refresh the page, you will often find that the error goes away.



The error is most likely not in django registration, but somewhere very unclear in one of your own views. I would try commenting out all the other urls and then re-enabling them one by one - restarting the dev server every time - to see when the error appears.

+4


a source







All Articles