Django allows you to reconstruct urls with the
reverse() function and
{% url %} template tag. You can reverse the url for a view by passing the view function itself, but this is not very practical. By setting a
name for a view, you can reverse the url by referencing this name instead. This allows you to easily construct links to other pages on your site. For example, if
question is an instance of your
Question model, you can link to it in a template like this:
<a href="{% url 'detail' question_id=question.id %}">{{ question.title }}</a> The
{% url %} tag will generate a link to the
'detail' view for this question.