Can I have a Django form without Model
|July 19, 2013||Posted by forumadmin under TechQns||
Can I have a Form in my template which is not backed by a model. I do not need to store the data just need that data to generate a POST request of my own in the view.
Template – The form with text fields.
View – get data from form, and generate another request.
Flow –> Form submit takes to a url which calls the view “
def form_handle(request): if request.method=='POST' form = request.POST #blah blah encode parameters for a url blah blah #and make another post request
but this puts only the csrf token into the form variable.
Is there some way I can access those text fields of the template in my form_handle view?
I know how to do it with a model but couldn’t figure this out!
|Asked By – AdRoiT||Read Answers|