Hi Suraj,
On 08/11/2019 08.26, Suraj Thapa FC wrote:
> How do I convert the requests into render or redirect....
>
> response = requests.post(url,data=post_data, headers={"Content-type"
> :"application/json" }).json()
>
You question doesn't make much sense since you don't write what you want
to achieve. A bit more context would be helpful.
Converting a JSON payload to an HTTP redirect is of course complete
nonsense.
Anyway, this might be helpful:
https://docs.djangoproject.com/en/2.2/ref/request-response/#jsonresponse-objects
Kind regards,
Kasper Laudrup
> --
> 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+unsubscribe@googlegroups.com
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPjsHcE2WvU5qmss37TsiiraHKAP9YG_n5%2BEJbSYAQiRsW7EDQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPjsHcE2WvU5qmss37TsiiraHKAP9YG_n5%2BEJbSYAQiRsW7EDQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ea999299-5d21-ce7b-4426-e7ce4581de36%40stacktrace.dk.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment