26👍
I think you forgot to set the namespace when including the polls urls.
In the root urlconf file
Change
url(r'^polls/', include('polls.urls')),
to
url(r'^polls/', include('polls.urls', namespace="polls")),
8👍
Yes, namespace issue for me as well – the above response helped me!
Really important to make sure you are in /polls not /admin/polls when you are inputting your server link on the browser.
Also, this works in path as well.
For mysite/polls/urls – please add the below line of code
app_name = 'polls'
and then also your mysite/mysite/urls should look like below:
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('polls/', include('polls.urls', namespace="polls")),
path('admin/', admin.site.urls),
]
- Django ALLOWED_HOSTS with ELB HealthCheck
- Multiply in django template
- Alter Django admin change list title text
- Disable pylint warning E1101 when using enums
- Django-signals vs triggers?
8👍
you should add app name as like below in polls/urls.py
, I had the same issue but solved it by adding this:
app_name = 'polls'
- Configure Django-rest
- 'Questions ' object is not iterable Django
- Get list of occurrences + count in a model Django?
- Making inlines conditional in the Django admin
- How do you rollback during Django shell session after causing DatabaseError?
Source:stackexchange.com