7👍
The error log reported there tells you most of what you need to know:
First you’ve got:
in test_main
response = c.get('/', follow=True)
Which means it’s dying while trying to process that request. Next:
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/test/client.py", line 281, in get
[...]
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/template/__init__.py", line 792, in render_node
return node.render(context)
It’s dying while rendering a node in the template, which means it’s getting to the template, not dying at the login. Last:
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/template/defaulttags.py", line 382, in render
raise e
NoReverseMatch: Reverse for '<django.contrib.auth.decorators._CheckLogin object at 0x22d4650>' with arguments '()' and keyword arguments '{'report_type': u'this_week'}' not found.
It’s raising an exception while trying to reverse a url in your template, which means you called the {% url %}
tag somewhere with the path to your view function and the argument “this_week”, but that’s not the appropriate way to call your view function according to your URLconf.
Fix your {% url %}
tag or your view function definition and it’ll work.
1👍
Did you check your regex’s in urls.py
? Maybe the are bogus.
Also check this Bug Ticket Reverse for ‘<django.contrib.auth.decorators._CheckLogin object at 0x8ee144c>’ not found
Btw. this is what the django source-code says around line 382 in defaulttags.py
# Try to look up the URL twice: once given the view name, and again
# relative to what we guess is the "main" app. If they both fail,
# re-raise the NoReverseMatch unless we're using the
# {% url ... as var %} construct in which cause return nothing.
- [Django]-Find the model name from a Django Rest framework Serializer
- [Django]-Overload get_FIELD_display() function
- [Django]-Prevent multiple logins using the same credentials
- [Django]-How can I combine two views and two forms into one single template?
- [Django]-Django reverse function arguments