--
Ticket URL: <https://code.djangoproject.com/ticket/28962>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Tim Graham):
I guess you're referring to an example like:
{{{
@permission_required('polls.can_vote', login_url='/loginpage/')
}}}
which instead could be something like (untested):
{{{
@permission_required('polls.can_vote', login_url=reverse_lazy('some-page-
nam'`))
}}}
(I think you mixed up terminology in calling `reverse()` and
`reverse_lazy()` "template tags"... probably you were thinking of the {%
url %} tag.)
I don't know if we should try to avoid hardcoding URLs in all examples. It
may make things a bit less readable. Nor am I sure if it's beneficial to
mention everywhere a URL is accepted that you can also use `reverse()` to
avoid hardcoding one. The topic of hardcoding URLs is discussed in the
tutorial, so hopefully a Django user would remember that and not need a
constant reminder.
--
Ticket URL: <https://code.djangoproject.com/ticket/28962#comment:1>
* status: new => closed
* resolution: => needsinfo
--
Ticket URL: <https://code.djangoproject.com/ticket/28962#comment:2>