python - Django Tutorial - Part 1 - URL didn't match -


this has been asked before, problems placement of mysite/urls.py or missing text somewhere. i've gone on in detail, doesn't apply here. i'm following django tutorial exactly, means hasn't referenced including polls app in settings.py file. can pull right view if manually type in "polls" @ end of url, in "http://127.0.0.1:8000/polls" shouldn't have work. i'm assuming tutorial isn't wrong in way. link tutorial is: https://docs.djangoproject.com/en/1.9/intro/tutorial01/

the error get:

page not found (404) request method: request url:    http://127.0.0.1:8000/ using urlconf defined in mysite.urls, django tried these url patterns, in order: ^polls/ ^admin/ current url, , didn't match of these. 

my views.py file:

from django.shortcuts import render django.http import httpresponse  def index(request):     return httpresponse("hello, world.  you're @ polls index.") 

my polls/urls.py file:

from django.conf.urls import url . import views  urlpatterns = [     url(r'^$', views.index, name='index'), ] 

my mysite/mysite/urls.py file:

from django.conf.urls import include, url django.contrib import admin  urlpatterns = [     url(r'^polls/', include('polls.urls')),     url(r'^admin/', admin.site.urls), 

]

this tree mysite/mysite directory show in right folder (there no separate urls.py file in main mysite directory):

. ├── __init__.py ├── __pycache__ │   ├── __init__.cpython-35.pyc │   ├── settings.cpython-35.pyc │   ├── urls.cpython-35.pyc │   └── wsgi.cpython-35.pyc ├── settings.py ├── urls.py └── wsgi.py 

again, best can tell letter following django tutorial guidance. i'd fix it, more importantly understand why isn't working.

have checked installed_apps variable in settings file include 'polls' app?


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -