NoReverseMatch Reverse for 'None' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

Raised by:

django/core/urlresolvers.py (line 496)

Traceback (most recent call last):
  File "python2.7/site-packages/django/core/handlers/base.py", line 164, in get_response
    response = response.render()
  File "python2.7/site-packages/django/template/response.py", line 158, in render
    self.content = self.rendered_content
  File "python2.7/site-packages/django/template/response.py", line 135, in rendered_content
    content = template.render(context, self._request)
  File "python2.7/site-packages/django/template/backends/django.py", line 74, in render
    return self.template.render(context)
  File "python2.7/site-packages/django/template/base.py", line 209, in render
    return self._render(context)
  File "python2.7/site-packages/django/template/base.py", line 201, in _render
    return self.nodelist.render(context)
  File "python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "python2.7/site-packages/django/template/loader_tags.py", line 135, in render
    return compiled_parent._render(context)
  File "python2.7/site-packages/django/template/base.py", line 201, in _render
    return self.nodelist.render(context)
  File "python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "python2.7/site-packages/django/template/loader_tags.py", line 135, in render
    return compiled_parent._render(context)
  File "python2.7/site-packages/django/template/base.py", line 201, in _render
    return self.nodelist.render(context)
  File "python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "python2.7/site-packages/django/template/loader_tags.py", line 135, in render
    return compiled_parent._render(context)
  File "python2.7/site-packages/django/template/base.py", line 201, in _render
    return self.nodelist.render(context)
  File "python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "python2.7/site-packages/django/template/loader_tags.py", line 65, in render
    result = block.nodelist.render(context)
  File "python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "python2.7/site-packages/django/template/loader_tags.py", line 65, in render
    result = block.nodelist.render(context)
  File "python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "python2.7/site-packages/django/template/defaulttags.py", line 217, in render
    nodelist.append(node.render(context))
  File "python2.7/site-packages/django/template/defaulttags.py", line 329, in render
    return nodelist.render(context)
  File "python2.7/site-packages/django/template/base.py", line 903, in render
    bit = self.render_node(node, context)
  File "python2.7/site-packages/django/template/debug.py", line 79, in render_node
    return node.render(context)
  File "python2.7/site-packages/django/template/defaulttags.py", line 217, in render
    nodelist.append(node.render(context))
  File "python2.7/site-packages/django/template/debug.py", line 89, in render
    output = self.filter_expression.resolve(context)
  File "python2.7/site-packages/django/template/base.py", line 647, in resolve
    obj = self.var.resolve(context)
  File "python2.7/site-packages/django/template/base.py", line 787, in resolve
    value = self._resolve_lookup(context)
  File "python2.7/site-packages/django/template/base.py", line 825, in _resolve_lookup
    current = getattr(current, bit)
  File "python2.7/site-packages/oscar/apps/dashboard/nav.py", line 31, in url
    kwargs=self.url_kwargs)
  File "python2.7/site-packages/django/core/urlresolvers.py", line 579, in reverse
    return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))
  File "python2.7/site-packages/django/core/urlresolvers.py", line 496, in _reverse_with_prefix
    (lookup_view_s, args, kwargs, len(patterns), patterns))
NoReverseMatch: Reverse for 'None' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

How to reproduce

Try to reverse with a None argument:

from django.core.urlresolvers import reverse

url_pattern = None
reverse(url_pattern)

How to fix

Make sure you are passing a non None argument to Django's reverse function.

from django.core.urlresolvers import reverse

assert url_pattern is not None
reverse(url_pattern)