Django Error u"'polls" is not a registered namespace

Solution 1:

The answer is to add namespaces to your root URLconf. In the mysite/urls.py file (the project’s urls.py, not the application’s), go ahead and change it to include namespacing:

urlpatterns = patterns('',
url(r'^polls/', include('polls.urls', namespace="polls")),
url(r'^admin/', include(admin.site.urls)),
)

Furthermore, in part 3 of the tutorial Namespacing URL names the use of app_name is mentioned as the accepted way for adding the polls namespace. You can add the line for this in your polls/urls.py as follows:

app_name = 'polls'
urlpatterns = [
    ...
]

Solution 2:

Following the same Django tutorial and having the same names, I had to change in mysite/urls.py from:

url(r'^polls/', include('polls.urls')),

to:

 url(r'^polls/', include('polls.urls', namespace="polls")),