tutorial 2.0 - 1: problem

34 views
Skip to first unread message

Denny Terreno

unread,
Mar 15, 2018, 8:03:57 PM3/15/18
to Django users
Hello,
I'm new to django, and I'm trying to learn it, but I'm stuck on the 1st part of the tutorial: https://docs.djangoproject.com/en/2.0/intro/tutorial01/

when I try the polls app it gives me "Page not found (404) Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
polls/
admin/
The empty path didn't match any of these."

it can't find (I guess) the url defined as shown in the tutorial:

urlpatterns = [
    path('polls/', include('polls.urls')),
    path('admin/', admin.site.urls),
]


by evaluating in python  path('polls/', include('polls.urls'))  the result is 
<URLResolver <module 'polls.urls' from 'C:\\Users\\ddeen\\Documents\\PYTHON\\mysite\\polls\\urls.py'> (None:None) 'polls/'>

Can anyone help me! I can't find anything else on the net!

I'm using windows 10, 
python 3.5
and django 2.0.3

Carl Brubaker

unread,
Mar 15, 2018, 9:44:23 PM3/15/18
to Django users
We could use some code from your myapp/urls.py and your myapp/polls/urls.py files. Without it, we don't know what is wrong.

Bernd Wechner

unread,
Mar 15, 2018, 10:34:34 PM3/15/18
to Django users
Looks to me like runserver is telling you more or less what's up. What it's not telling you is what you've not told us, namely teh URL you're navigating to.

But the tutorial suggests " http://localhost:8000/polls/"

and if you are using that, and you have set up polls/urls.py as the tutorial states, then that URL should resolve.Assuming the file:


C:\\Users\\ddeen\\Documents\\PYTHON\\mysite\\polls\\urls.py

exists and contains the tutorial recommends.

Cheers,

Bernd.

Reply all
Reply to author
Forward
0 new messages