django form doesn't work on click submit

前端 未结 2 1224
醉酒成梦
醉酒成梦 2021-01-26 13:21

I\'m trying to do a form, with gender choices. The user could choice between male or female.

What I have now in forms.py:

class GenderForm(forms.Form):
          


        
2条回答
  •  感动是毒
    2021-01-26 14:23

    You have to define url where post data will be sent

    This will send post data to url /my_app/my_view/

    {% for field in form_gender %} {{ field }} {% endfor %}

    This will send post data to current url you are on.

    {% for field in form_gender %} {{ field }} {% endfor %}

提交回复
热议问题