- [Answered ]-Writable nested Django serializer with string instead of dict
- [Answered ]-TypeError: "ModelBase is not iterable"
0👍
Thank you Harrison and Cychih for your answer, I tried however, they don’t work. The solution I found is this :
newstring = input1.replace('\r\n', ' ')
It’s
'\r\n'
not
'\n'
When I put in the form 3 lines like this ;
Line 1
Line 2
Line 3
Here is the output of the request.POST
<QueryDict: {'input1': ['Line 1 \r\nLine 2\r\nLine 3\r\n'], 'csrfmiddlewaretoken': ['tvC0ISHPNEkdQzocuVRnhJCp5yadDkgC5wf832blrpYPP0MZVV1iNY5bI2cYXsA4'], 'output1': [' ']}>
I don’t know why new line is set as \r\n but it’s the way it is .
Thank you again for your help!
- [Answered ]-Pip install error: ModuleNotFoundError No module named 'setuptools'
- [Answered ]-Form in django form.as_p different
- [Answered ]-Employing caching for the first page of a paginated view in Django
- [Answered ]-How to iterate over json object in python containing dictionary and list
Source:stackexchange.com