Monday, October 20, 2014

Re: djangoproject.com tutorial part 3

I am calling the page with "python manage.py runserver 0.0.0.0:8000" When I load up the page before adding the views and urls files, I see the polls and everything that I have set up with the codes from the previous pages of the tutorial. After adding the  views and urls files, the page looks the same like, even though the direction tells me that I should see the "Hello world" message that I put in the views file. I ran another directory with different way to put up the views like in this tutorial (http://www.djangobook.com/en/2.0/chapter03.html) and I got the views working by itself, but using the djangoproject tutorial, I do not see the message.

On Monday, October 20, 2014 3:48:33 AM UTC-7, Lee wrote:
When you say nothing changes, how are you calling the page? And what do you see in your browser - any error message or stack trace or is it just a blank page?

Also I assume the below were copied from the tutorial. Can you post the contents of the three files as you typed them in your code?

On Monday, 20 October 2014 04:31:57 UTC+1, Tri Vo wrote:
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/70183f2b-a7d6-4280-a264-f6f5122d1120%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment