* * *
###Problem description
In many cases, if we want to modify the attribute value in the ‘request’ of the ‘Django’ project, an error will be reported to us:
“`
attributeerror: this querydict instance is immutable“`
That’s because in the official narration, the object is a non modifiable object. What should we do if we want to continue to try to modify the value in it
###Solutions
> This issue of push collates Python materials that beginners may use, including books/videos/online documents and editor/source
code. About the installation of ‘Python’, Qun: 850973621
“`
def medusa(request):
request.POST._ mutable = True
# or:
# request. Get_ Mutable = true
copy code
“`
At this point, when you need to modify the data value of the ‘request’ object, you can achieve the desired effect
Similar Posts:
- How to Solve Request processing failed; nested exception is java.lang.NullPointerException
- The front-end XMLHttpRequest object sets an error in the request header
- The interface method is not rewritten, and the idea does not report an error.
- Differences of urllib, urllib2, httplib and httplib2 libraries in Python
- [Solved] Axios Cross-domain issues: No ‘Access-Control-Allow-Origin‘ header is present on the requested resource.
- Python: Centos + gunicorn+flask ImportError: No module named request
- [Solved] ASP.NET Error: Request is not available in this context
- Call JIRA API to create issue prompt xsrf check failed
- XHR request status is the solution to failed
- Python Error:Exception Value:can only concatenate str (not “bytes”) to str