Index: django/conf/urls/defaults.py
===================================================================
--- django/conf/urls/defaults.py	(revision 981)
+++ django/conf/urls/defaults.py	(working copy)
@@ -1,3 +1,4 @@
+import sys
 from django.core.urlresolvers import RegexURLPattern, RegexURLResolver
 
 __all__ = ['handler404', 'handler500', 'include', 'patterns']
@@ -7,7 +8,33 @@
 
 include = lambda urlconf_module: [urlconf_module]
 
+
+def _get_prefix():
+    """
+    Figures out the prefix for the calling URLconf module.
+
+    If the calling URLconf is at:
+        myproject.apps.polls.urls
+    the returned prefix will be:
+        myproject.apps.polls.views.polls
+    """
+    f = sys._getframe(2)
+    module = f.f_globals["__name__"]
+    segs = module.split(".")
+    # get rid of the 'urls' segment
+    segs.pop()
+    # now the last segment is the apps name
+    app_name = segs[-1]
+    # inject the 'views' module
+    segs.append("views")
+    # add the apps name to the end
+    segs.append(app_name)
+    # return the generated prefix
+    return ".".join(segs)
+
 def patterns(prefix, *tuples):
+    if prefix is None:
+        prefix = _get_prefix()
     pattern_list = []
     for t in tuples:
         if type(t[1]) == list:
