1

Page not found (404)
Request Method: GET>br> Request URL: http://127.0.0.1:8000/votes/
Using the URLconf defined in votes.urls, Django tried these URL patterns, in this order:
^$ [name='index']
The current path, votes/, didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

this is my urls.py of my app.

from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^$', views.index, name='index'),
]

this is my urls of my entire project

from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
    url(r'^votes/', include('votes.urls')),
    url(r'^admin/', admin.site.urls),
]

I tried to approach to admin site but i couldn't. how can I fix it?

Brown Bear
  • 19,655
  • 10
  • 58
  • 76
J man
  • 21
  • 1
  • 3

1 Answers1

1

In your app urls.py your saying that: http://127.0.0.1:8000/ should call votes.views.index not http://127.0.0.1:8000/votes/, so you need to change it to:

from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^votes/$', views.index, name='index'),
]
ddalu5
  • 401
  • 4
  • 17