i am learning django by using django 1.6 documents tutorial 1 - 6. this round is my 4th try and, previous 3 try was successful and i understand more on every try.
i am in tutorial 3 now, to create views.
according to the documents, after i created a view, i need to map it to a URL. so i follow the documents to add a urls.py in the polls directory. and then i follow the document to add include() to mysite/urls.py i am able to so called wired an index view into the polls view.
now if i go back to localhost:8000, i get an error page, so my question is 1) WHY? 2) how to get back my localhost:8080 index page co-exist with the polls index page?
thank you very much everyone for your time. i am new and sorry for so simple question. thank you.
updated: this is my urls.py
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'mysite.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^polls/', include('polls.urls')),
)
this is my polls/urls.py
from django.conf.urls import patterns, url
from polls import views
urlpatterns = patterns('',
url(r'^$', views.index, name='index')
)
the error msg is:
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
^admin/
^polls/
The current URL, , didn't match any of these.