0

I'm having a tough time debugging this particular error. I have the following in my urls.py:

url(r'^report/(?P<share_url>\w+)/$', 'share', 
  name='share'),
url(r'^report/(?P<share_url>\w+)/revoke/$', 'share_revoke',
  name='share_revoke'),

In views.py I have:

def share(request, share_url):
  ...

@login_required
def share_revoke(request, share_url):
  ...

In my template I have:

<a href='{% url share share_url %}'>Share</a>
<a href='{% url share_revoke share_url %}'>Revoke</a>

When I try and load this template, I get a NoReverseMatch:

NoReverseMatch at /mypath/

Reverse for 'share_revoke' with arguments '(u'Sh4rE',)' and keyword arguments '{}' not found.

Why is it failing for the second url and not the first? I am logged in.

Trying this on the shell:

>>> reverse('share',args=(u'klajsdf',))
'/report/klajsdf/'

>>> reverse('share_revoke',args=(u'klajsdf',))
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/ubuntu/virt/virt1/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 476, in reverse
    return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
  File "/home/ubuntu/virt/virt1/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 396, in _reverse_with_prefix
    "arguments '%s' not found." % (lookup_view_s, args, kwargs))
NoReverseMatch: Reverse for 'share_revoke' with arguments '(u'klajsdf',)' and keyword arguments '{}' not found.
Community
  • 1
  • 1
fredley
  • 32,953
  • 42
  • 145
  • 236

1 Answers1

0

This was a non-issue in the end. My problem was SublimeText2 SFTP had got confused and wasn't overwriting the urls.py on my server, hence the large amount of wtf.

fredley
  • 32,953
  • 42
  • 145
  • 236