The number of GET/POST parameters exceeded settings.DATA_UPLOAD_MAX_NUMBER_FIELDS

前端 未结 2 1335
灰色年华
灰色年华 2021-02-06 22:35

I got an error: \"The number of GET/POST parameters exceeded settings.DATA_UPLOAD_MAX_NUMBER_FIELDS\".

Error says that TooManyFieldsSent at /api/upload.

2条回答
  •  时光说笑
    2021-02-06 23:16

    as django's doc says, the value of DATA_UPLOAD_MAX_NUMBER_FIELDS is default 1000, so once your form contains more fields than that number you will get the TooManyFields error.

    check out here: https://docs.djangoproject.com/en/1.11/ref/settings/

    so the solution is simple I think, if DATA_UPLOAD_MAX_NUMBER_FIELDS exists if your settings.py, change it's value to a higher one, or, if it doesn't, add it to settings.py:

    DATA_UPLOAD_MAX_NUMBER_FIELDS = 10240 # higher than the count of fields
    

提交回复
热议问题