0

This is related to Django: 'module' object has no attribute 'index'.

I have very similar files to that poster, and have been following the same first django tutorial. Here's my project/urls.py. A slight modification causes it to fail.

from django.conf.urls import include,url
from django.contrib import admin

urlpatterns = [
    url(r'^polls/', include('polls.urls')),
    #url(r'^redis/', include('redis.urls')),
    url(r'^admin/', admin.site.urls),
]

Uncommenting that line causes this error:

Exception Type: AttributeError
Exception Value: 'module' object has no attribute 'index'

Edit: I have implemented the other question's solution, but I would like to know why this breaks it. Shouldn't it just return the wrong module's index, rather than an AttributeError?

2
  • 1
    The error is probably in your polls/urls.py file... which you haven't shown but the solution is the same as the duplicate. Commented Oct 31, 2016 at 7:37
  • 1
    Or, your redis/urls.py file Commented Oct 31, 2016 at 9:05

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.