Tuesday, November 27, 2018

Re: runserver error rectification

import polls in  mysite/mysite/urls.py
i think it will work


On Tue, Nov 27, 2018 at 3:00 PM Sanjay Malviya <sanjay6787@gmail.com> wrote:
What modification to codes required, pls in project mysite/mysite/polls(app)
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/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),
]


On Mon, Nov 26, 2018 at 10:57 AM Jason <jjohns98684@gmail.com> wrote:
whatever you have as url patterns is not a list, tuple or other iterable.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20504ff8-1711-4b9b-9b60-300083a8a60c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN%2BaYhcmUXjGgSeGazYB3c99t0XpgF_y4ykA64ePm%2B_uFApx3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMsYeuFYvZkTvX67LkguVWAL_WjEBc2nZXfOcfmxJaTo5Oh4kQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment