Answer the question
In order to leave comments, you need to log in
How to work with forms and POST requests in Django?
Friends, hello everyone!
I'm a beginner Dzhangovod, I'm trying to write a web client that should take data from a web form with a POST, forward it to an external server with a GET and return a response to the form.
Can you post an implementation example?
I have now gone along the path of creating the forms.py file in the application directory, but I can’t find anything other than examples with the CreateView method. I do not need to work with the database in this application.
Thank you!
Answer the question
In order to leave comments, you need to log in
POST to take data, forward it to the external server with GET and return the response to the form.
Can you post an implementation example?
class YouView(View):
def post(self, request):
you_data_1 = request.POST.get("youData1")
you_data_2 = request.POST.get("youData2")
you_data_3 = request.POST.get("youData3")
forward them to the external server with a GET and return a response to the form.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question