Page not found 404 on Django site?

前端 未结 13 2327
既然无缘
既然无缘 2020-12-14 00:46

I\'m following the tutorial on Django\'s site to create a simple poll app. However, Django is unable to resolve \"//127.0.0.1:8000/polls\" , even though I\'ve defined the re

13条回答
  •  鱼传尺愫
    2020-12-14 00:58

    You're accessing to http://yourdomain.com/, and you don't have any URL defined for "/".

    You have two options:

    1. If you want to access to the index page of your polls application you have to enter the URL: yourdomain.com/polls

    2. You can also modify you mySite/urls.py file to access from just yourdomain.com

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

提交回复
热议问题