django - what goes into the form action parameter when view requires a parameter?

后端 未结 4 1203
后悔当初
后悔当初 2020-12-13 18:30

This is what I have:

myview.py with a view that takes a parameter user:

def myview(request, user):
   form = MyForm(reques         


        
4条回答
  •  失恋的感觉
    2020-12-13 19:00

    You are posting to the same view that also serves the form. So at first, the view is called and serves the form. When you post the form, the same view gets called but this time you process the form. That's why the action is empty.

提交回复
热议问题