On Tue, 2007-06-19 at 18:48 -0700, johnny wrote:
> When I use render_to_response, can I have routing url in it like '/
> posts/all/' or
> I have to have '/posts/all.html''?
> 
> My small code:
> # I am passing list of objects called 'posts' to template
> return render_to_response('/posts/all/', {'posts': posts})
> 
> In my browser, I want to have pretty url like "mysite/posts/all/" not
> "mysite/posts/all.html".

render_to_response() has nothing to with the URL. The first parameter is
the name of the template file to use for the rendering. Traditionally
(but not always and it's not compulsory), they have ".html" extensions.

The URL for the response has already been determined: it was what the
client requested in the original request (unless you use an HTTP
redirect or something).

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to