Groups
Sign in
Groups
Django users
Conversations
About
Send feedback
Help
Redirect to external url with parameters in django
1,901 views
Skip to first unread message
Hossein Rashnoo
unread,
Jan 27, 2015, 2:30:05 AM
1/27/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
I want when a user do something in my view then i redirect him to another website with some parameters as POST method Like when you submit a form.
I think its may be something like this:
return HttpResponseRedirect("url","parameters")
How can i do that?
Stephen J. Butler
unread,
Jan 27, 2015, 2:39:48 AM
1/27/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Use django.utils urlencode.
return HttpResponseRedirect(base_url + '?' + urlencode(params))
Note that a redirect is always turned into a GET request, never a
POST. If you really need POST you'll have to construct a page with the
proper form elements, and then either have the user submit it (no-js)
or post it using JavaScript yourself.
> --
> 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...@googlegroups.com
.
> To post to this group, send email to
django...@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/6650db6b-1bd9-4f70-bbee-ed6bca3b95c2%40googlegroups.com
.
> For more options, visit
https://groups.google.com/d/optout
.
Reply all
Reply to author
Forward
0 new messages