Django - taking values from POST request

前端 未结 3 1141
旧巷少年郎
旧巷少年郎 2020-11-30 23:57

I have the following django template (http://IP/admin/start/ is assigned to a hypothetical view called view):

{% for source in sources %}
  
    &l         


        
3条回答
  •  不知归路
    2020-12-01 00:24

    Read about request objects that your views receive: https://docs.djangoproject.com/en/dev/ref/request-response/#httprequest-objects

    Also your hidden field needs a reliable name and then a value:

    
    

    Then in a view:

    request.POST.get("title", "")
    

提交回复
热议问题