On Sun, 2008-10-05 at 20:21 -0700, Bobby Roberts wrote:
> Hi group.  I have  form on the right side of my website.  It's a
> simple site consisting of a single template and utlizes flat pages.
> Now i can create content just fine and that is all working.  The issue
> is that the form is not showing up when I view the site.  I'm assuming
> that it is because something is awry with the urls or views.  I think
> i've narrowed it down to the following question.
> 
> How can I specify that the form show and work on each page in the
> website? I've tried the following in my urls.py file:
> 
>     (r'/$', 'myForm'),
> 
> 
> where myForm is my view

Django only processes one view per request, so that particular pattern
says that if the request is for "/" (only!), the myForm view should be
called. And that is all.

If you want to form to be included in each and every template, then you
can either use a context processor, or you could put it in a common
function that each of your views call at the end. I tend to do the
latter fairly regularly, since there's a bunch of stuff I do in each
(well, most) views. So rather than calling render_to_response(), I call
finalise_view_processing() -- my own function -- that does all the final
common stuff and then calls render_to_response with the modified data.

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 django-users@googlegroups.com
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