I am working on a django tutorial for version 1.8 and I get an error message that I am stuck and cannot understand. I thought I was following T. carefully.
I have the following tree installed:
. βββ dj_project β βββ __init__.py β βββ __init__.pyc β βββ settings.py β βββ settings.pyc β βββ urls.py β βββ urls.pyc β βββ wsgi.py β βββ wsgi.pyc βββ manage.py βββ polls βββ admin.py βββ admin.pyc βββ __init__.py βββ __init__.pyc βββ migrations β βββ 0001_initial.py β βββ 0001_initial.pyc β βββ __init__.py β βββ __init__.pyc βββ models.py βββ models.pyc βββ tests.py βββ urls.py βββ urls.pyc βββ views.py βββ views.pyc
and, as in the survey tutorial /urls.py :
from django.conf.urls import url from . import views urlpatterns = { url(r'^$', views.index, name='index'), }
and for my dj_project / urls.py :
from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ url(r'^polls/', include('polls.urls')), url(r'^admin/', include(admin.site.urls)), ]
and in polls /views.py I have:
from django.shortcuts import render from django.http import HttpResponse def index(request): return HttpResponse("is there something here?")
so when I go to <mysite>/polls , I see that "there is something here", but if I go to <mysite>/admin , I get an error: TypeError at /admin/ argument to reversed() must be a sequence . If I delete polls from urlpatterns in dj_project/urls.py , the admin comes in order.
What could be the problem? I don't seem to understand.