from django.core.urlresolvers import RegexURLPattern, RegexURLResolver

__all__ = ['handler404', 'handler500', 'include', 'patterns', 'url']

handler404 = 'django.views.defaults.page_not_found'
handler500 = 'django.views.defaults.server_error'

include = lambda urlconf_module: [urlconf_module]

def patterns(prefix, *args):
    pattern_list = []
    for t in args:
        if isinstance(t, (list, tuple)):
            t = url(prefix=prefix, *t)
        elif isinstance(t, RegexURLPattern):
            t.add_prefix(prefix)
        pattern_list.append(t)
    return pattern_list

def url(regex, view, kwargs=None, name=None, prefix=''):
    if type(view) == list:
        # For include(...) processing.
        return RegexURLResolver(regex, view[0], kwargs)
    else:
        if prefix and isinstance(view, basestring):
            view = prefix + '.' + view
        return RegexURLPattern(regex, view, kwargs, name)


@@ -63,16 +63,72 @@
 Resolver
+%0Afrom django.core.exceptions import ImproperlyConfigured
 %0A%0A__all_
@@ -833,19 +833,8 @@
  if 
-prefix and 
 isin
@@ -859,16 +859,181 @@
 tring):%0A
+            if not view:%0A                raise ImproperlyConfigured('Empty URL pattern view name not permitted (for pattern %25r)' %25 regex)%0A            if prefix:%0A    
         

Report an error if urlpatterns contain a string view name and it is empty. Refs #4319.