Code

Opened 7 years ago

Closed 7 years ago

#5732 closed (fixed)

urls.py import error

Reported by: ChCh Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:

Description

I've forgotten to create urls.py, but included it in.
Strange errors were happened (single request after server restart - error, next requests - url tag does not work).
After some work on this problem I have made this patch for django/core/urlresolvers.py :


*** urlresolvers.py.ORIG        Wed Oct 10 20:13:21 2007
--- urlresolvers.py     Wed Oct 10 20:38:57 2007
***************
*** 253,256 ****
--- 253,259 ----
                  # Invalid urlconf_name, such as "foo.bar." (note trailing period)
                  raise ImproperlyConfigured, "Error while importing URLconf %r: %s" % (self.urlconf_name, e)
+             except ImportError, e:
+                 # URL file not exist
+                 raise ImproperlyConfigured, "Error while importing URLconf %r: %s" % (self.urlconf_name, e)
              return self._urlconf_module
      urlconf_module = property(_get_urlconf_module)

and have got verbose error info.

Andrey Chichak

Attachments (0)

Change History (1)

comment:1 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [6584]) Fixed #5732 -- Catch all possible errors when importing a URLConf file. This
leads to error messages that contain the name of the problem file (useful when
the problem is part of an include() import).

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.