Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #8975 -- Added a note to the documentation for reverse() that a…

…ll views

must be importable for URL reversing to work correctly.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9167 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit fa63f1642d3899324a6d051e964ce4b878170ff9 1 parent cddece2
Malcolm Tredinnick malcolmt authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 docs/topics/http/urls.txt
14 docs/topics/http/urls.txt
View
@@ -620,6 +620,20 @@ vertical bar (``"|"``) character. You can quite happily use such patterns for
matching against incoming URLs and sending them off to views, but you cannot
reverse such patterns.
+.. admonition:: Make sure your views are all correct
+
+ As part of working out which URL names map to which patterns, the
+ ``reverse()`` function has to import all of your URLConf files and examine
+ the name of each view. This involves importing each view function. If
+ there are *any* errors whilst importing any of your view functions, it
+ will cause ``reverse()`` to raise an error, even if that view function is
+ not the one you are trying to reverse.
+
+ Make sure that any views you reference in your URLConf files exist and can
+ be imported correctly. Do not include lines that reference views you
+ haven't written yet, because those views will not be importable.
+
+
permalink()
-----------
Please sign in to comment.
Something went wrong with that request. Please try again.