I know this question has been asked before, but I haven't found an answer that solves my situation. I'm looking at the Django tutorial, and I've set up the first URLs exactly as the tutorial has it, word for word, but when I go to http://http://loca

84 views
Skip to first unread message

Avitab Ayan Sarmah

unread,
Apr 22, 2018, 1:15:27 PM4/22/18
to Django developers (Contributions to Django itself)
polls/views.py
from django.http import HttpResponse


def index(request):
    return HttpResponse("Hello, world. You're at the polls index.")

polls/urls.py
from django.urls import path

from . import views

urlpatterns = [
    path('', views.index, name='index'),
]

mysite/urls.py
from django.contrib import admin
from django.urls import include, path

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

Don Guernsey

unread,
Apr 22, 2018, 1:44:36 PM4/22/18
to django-d...@googlegroups.com
Include app_name = ‘polls’ in urls.py 

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/33f0ee3a-fcb7-4c4d-88cd-5d5a429be55e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

krazysoccerboy

unread,
Apr 23, 2018, 7:32:51 AM4/23/18
to Django developers (Contributions to Django itself)
add /polls at the end of your url or if you want this to be executed in home page then in mysite/urls.py remove 'polls/' in url and just leave with those quotation

Avitab Ayan Sarmah

unread,
Apr 23, 2018, 9:18:11 AM4/23/18
to django-d...@googlegroups.com
Thank you :)

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.

Tim Graham

unread,
Apr 23, 2018, 9:54:49 AM4/23/18
to Django developers (Contributions to Django itself)
For future reference, this mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow.
Reply all
Reply to author
Forward
0 new messages