I fully understood that and I thought it was implied in that I said I
was working with the tutorial I would have that file created. You only
asked where my template dir was directed to and that I put urls.py in
my reply, I would have put this in there if you had requested. Here it
is. Now, as far as I understand you only have to put the path in the
loader form the end of the template_dirs variable. Do I have to put
the abs path or do I have another issue.


  GNU nano 2.2.4              File: views.py

# Create your views here.
from django.template import Context, loader
from polls.models import Poll
from django.http import HttpResponse

def index(request):
    latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5]
    t = loader.get_template('polls/index.html')
    c = Context({
        'latest_poll_list': latest_poll_list,
    })
    return HttpResponse(t.render(c))

def detail(request, poll_id):
    return HttpResponse("You are viewing Poll %s." % poll_id)

def results(request, poll_id):
    return HttpResponse("You are looking the results of Poll %s." %
poll_id)

                               [ Read 23 lines ]


On Oct 21, 4:09 pm, Robbington <robbing...@hotmail.co.uk> wrote:
> You see, what I tried to explain in the last message, my friend was
> that index in 'polls.views.index') doesnt point the url polls/ to the
> index.html but to the function you are suppose to create in the
> views.py file in your app directory.
>
> Your view.py file (inside your poll app folder)should look like
>
> from django.http import HttpResponse
>
> def index(request):
>     return HttpResponse("Hello world blah blah blah")
>
> I can see that its a bit confusing.
>
> Rob

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to