You should import the polls urls as it appears in the tutorial
url(r'^polls/', include('polls.urls')),
On 3/3/17, Yves S. Garret <[email protected]> wrote:
> Like this:
>
> from django.conf.urls import include, url
> from django.contrib import admin
>
> urlpatterns = [
> url(r'^polls/', urls),
> url(r'^admin/', admin.site.urls),
> ]
>
> Is there a way to print out strings to indicate where the problem is?
>
> On Friday, March 3, 2017 at 8:35:47 AM UTC-5, Vijay Khemlani wrote:
>>
>> How does your learning_python.urls look like?
>>
>> On 3/3/17, Yves S. Garret <[email protected] <javascript:>> wrote:
>> > Yes.
>> >
>> > On Thursday, March 2, 2017 at 11:09:58 AM UTC-5, Vijay Khemlani wrote:
>> >>
>> >> Did you do this step?
>> >>
>> >> The next step is to point the root URLconf at the polls.urls module. In
>> >>
>> >> mysite/urls.py, add an import for django.conf.urls.include and insert
>> an
>> >> include()
>> >> <
>> https://docs.djangoproject.com/en/1.10/ref/urls/#django.conf.urls.include>
>>
>>
>> >> in
>> >> the urlpatterns list, so you have:
>> >> mysite/urls.py
>> >>
>> >> from django.conf.urls import include, urlfrom django.contrib import
>> admin
>> >> urlpatterns = [
>> >> url(r'^polls/', include('polls.urls')),
>> >> url(r'^admin/', admin.site.urls),]
>> >>
>> >>
>> >> On Thu, Mar 2, 2017 at 11:40 AM, Yves S. Garret <[email protected]
>> >>
>> >> <javascript:>> wrote:
>> >>
>> >>> Hi all,
>> >>>
>> >>> I'm going through this tutorial:
>> >>> https://docs.djangoproject.com/en/1.10/intro/tutorial01/
>> >>>
>> >>> And the problem that I'm having is when I start the 'polls'
>> application
>> >>> from inside my project and then go to localhost:8000/polls, I get a
>> 404.
>> >>>
>> >>> Page not found (404)
>> >>> Request Method: GET
>> >>> Request URL: http://localhost:8000/polls
>> >>>
>> >>> Using the URLconf defined in learning_python.urls, Django tried these
>> >>>
>> >>> URL patterns, in this order:
>> >>>
>> >>> 1. ^admin/
>> >>>
>> >>> The current URL, polls, didn't match any of these.
>> >>>
>> >>>
>> >>> I did everything as the tutorial told me, so I'm a little bit lost as
>> >>>
>> to
>> >>>
>> >>> why this is happening. Thanks in advance.
>> >>>
>> >>> --
>> >>> 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 [email protected] <javascript:>.
>> >>> To post to this group, send email to [email protected]
>> >>> <javascript:>.
>> >>> 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/56610bfb-c82b-426c-8346-ec8abe2300d5%40googlegroups.com
>>
>> >>>
>> >>> <
>> https://groups.google.com/d/msgid/django-users/56610bfb-c82b-426c-8346-ec8abe2300d5%40googlegroups.com?utm_medium=email&utm_source=footer>
>>
>>
>> >>> .
>> >>> 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 [email protected] <javascript:>.
>> > To post to this group, send email to [email protected]
>> <javascript:>.
>> > 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/d1be737c-05de-4f0b-8dd0-abe7ac3f0aa4%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 [email protected].
> To post to this group, send email to [email protected].
> 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/4f860c1e-cedc-4719-af38-31a6a7c87d4f%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 [email protected].
To post to this group, send email to [email protected].
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/CALn3ei3G7q_pe67GogrFh2UvNKsahM4pkMLEOvep_A7dkPZ79A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.