Sunday, October 19, 2014

djangoproject.com tutorial part 3

So I am following the tutorial in this site, and copy and the first three codes into my project (polls/views.py, polls/urls.py, and mysite/urls/py)
https://docs.djangoproject.com/en/1.7/intro/tutorial03/

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.conf.urls import patterns, url    from polls import views    urlpatterns = patterns('',      url(r'^$', views.index, name='index'),  )  

The next step is to point the root URLconf at the polls.urls module. In mysite/urls.pyinsert an include(), leaving you with:

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

When I launch my site, nothing changes. I do not see the "hello, world..." message at all. What did I do wrong?

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3b37469c-3fcb-48b5-81d9-a75190c1c432%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment