﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13398	reverse() causes exception if run in views.py, outside of a view.	cbarnell	nobody	"Running reverse('my_url_conf_name') inside of views.py will raise ViewDoesNotExist exception.

Example:


{{{
# myproject.apps.someapp.views.py
from django.core.urlresolvers import reverse

foo_url = reverse('foo_view')

def spam_view():
    return HttpResponse('Hello World')


# Running any view in this module will raise something like:
# ""Tried spam_view in module myproject.apps.someapp.views. Error was: 'module' object has no attribute 'spam_view'""
# Notice that 'spam_view' isn't even the view I passed in, and in fact if I delete the call to reverse() I can visit the 'spam_view' and it works fine.
# If I put the call to reverse('foo_view') inside of a view, and visit that view to render the url out to a page, it works just fine.
}}}
"		closed	Uncategorized	dev		invalid			Unreviewed	0	0	0	0	0	0
