Yesterday I was working on my first app using this tutorial. It\'s a Poll and Choice app. The first page displays the question and when you click on the question it\'s suppose t
Inside myapp/urls.py add the following module-level attribute:
app_name = "polls"
This will set the "application namespace name" for that application. When you use names like "polls:submit" in a reverse, Django will look in two places: application namespaces (set like above), and instance namespaces (set using the namespace= parameter in the "url" function). The latter is important if you have multiple instances of an app for your project, but generally it's the former you want.
I had this very issue, and setting namespace= into the url() function seemed wrong somehow.
See this entry of the tutorial: https://docs.djangoproject.com/en/1.9/intro/tutorial03/#namespacing-url-names
Update: this information is correct for Django 1.9. Prior to 1.9, adding a namespace= attribute to the include is, indeed, the proper way.