You could check the "referer" http header on you view, and then do a
redirect.

So, your signup form will always post to say /signup/save, and this
would be a view to handle the request:

def signup(request):
    if request.method == 'POST':
        forward_url = request.META.get('HTTP_REFERER', '/')  # find
out where the submission came from, else assume the root of your app

        do_something() # put your own code here

        return HttpResponseRedirect(forward_url) # you should attach
validation error msgs here
    return HttpResponseBadRequest()


Check the documentation on forms to see how to pass validation data.
http://docs.djangoproject.com/en/dev/topics/forms/#using-a-form-in-a-view

[]'s

Rodolfo


On Sep 6, 9:16 am, MikeHowarth <[EMAIL PROTECTED]> wrote:
> Can't seem to find anything of relevance in the docs, so wondering if
> someone could help me.
>
> Basically I want to put an email signup form in the footer of my site,
> which I can display errors/success message in place.
>
> Other than using Ajax to post this info in the background is there a
> way in Django to actually have a form on a page which has an action
> to another page and return error messages/success message back to the
> previous one i.e hooking in to global error variables or similar?
>
> Any one any ideas?
--~--~---------~--~----~------------~-------~--~----~
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