﻿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
6537	Unhelpful error message:  'tuple index out of range'	Michael@…	nobody	"There's something evidently wrong with my urls.py, but this error message is absolutely no help in sorting it out. Please have it output ''which tuple'' it's trying to index. The error message is providing no context, and unlike normal python tracebacks it is not tied to a particular line in my urls.py.

{{{
Traceback (most recent call last):

  File ""c:\django\django\core\servers\basehttp.py"", line 277, in run
    self.result = application(self.environ, self.start_response)

  File ""c:\django\django\core\servers\basehttp.py"", line 631, in __call__
    return self.application(environ, start_response)

  File ""c:\django\django\core\handlers\wsgi.py"", line 205, in __call__
    response = self.get_response(request)

  File ""c:\django\django\core\handlers\base.py"", line 130, in get_response
    callback, param_dict = resolver.resolve500()

  File ""c:\django\django\core\urlresolvers.py"", line 275, in resolve500
    return self._resolve_special('500')

  File ""c:\django\django\core\urlresolvers.py"", line 264, in _resolve_special
    callback = getattr(self.urlconf_module, 'handler%s' % view_type)

  File ""c:\django\django\core\urlresolvers.py"", line 255, in _get_urlconf_module
    raise ImproperlyConfigured, ""Error while importing URLconf %r: %s"" % (self.urlconf_name, e)

ImproperlyConfigured: Error while importing URLconf 'reports.urls': tuple index out of range
}}}

Here's the urls.py that is evidently not acceptable, but I cannot see which tuple of tuples of tuples it is trying to index and failing on:
{{{
from django.conf.urls.defaults import *
import views as views
import settings

urlpatterns = patterns('',
    # Example:
    # (r'^reports/', include('reports.foo.urls')),
    (r'^$', views.home_page),
)

if settings.DEBUG:
    urlpatterns += patterns('',
        (r'^images/(?P<path>.*)$', 'django.views.static.serve',
         {'document_root': 'c:/projects/djcode/reports/images'}),
        (r'^css/(?P<path>.*)$', 'django.views.static.serve',
         {'document_root': 'c:/projects/djcode/reports/css'}),
    )
}}}
{{{"		closed	Core (Other)	dev		duplicate	url error message tuple index		Accepted	1	0	0	0		
