Murad
Murad

Reputation: 1

Unable to update models with File field on Django admin or through post method

I have a Django application in the production environment. It works fine when I use runserver by IP address, even in the production environment. but when I try to access it through domain it does not allow me to update the file field (Image Field) the request takes too long and I keep getting <method 'read' of 'lsapi_wsgi.InputStream' objects> returned NULL without setting an error in my error log and it does not even allow me to login to Django admin page on PC's(only Mobile).
full trace error

SystemError at /admin/accounts/user/1/change/
<method 'read' of 'lsapi_wsgi.InputStream' objects> returned NULL without setting an error
Request Method: POST
Request URL:    https://dev.temarico.com/admin/accounts/user/1/change/
Django Version: 4.1.7
Exception Type: SystemError
Exception Value:    
<method 'read' of 'lsapi_wsgi.InputStream' objects> returned NULL without setting an error
Exception Location: /home/temaricocom/virtualenv/API/Backends/3.8/lib/python3.8/site-packages/django/core/handlers/wsgi.py, line 28, in _read_limited
Raised during:  django.contrib.admin.options.change_view
Python Executable:  /home/temaricocom/virtualenv/API/Backends/3.8/bin/python
Python Version: 3.8.12
Python Path:    
['/home/temaricocom/API/Backends',
 '',
 '/home/temaricocom/API/Backends',
 '/opt/alt/python38/lib64/python38.zip',
 '/opt/alt/python38/lib64/python3.8',
 '/opt/alt/python38/lib64/python3.8/lib-dynload',
 '/home/temaricocom/virtualenv/API/Backends/3.8/lib64/python3.8/site-packages',
 '/home/temaricocom/virtualenv/API/Backends/3.8/lib/python3.8/site-packages']
Server time:    Sun, 19 Mar 2023 09:45:19 +0300

Upvotes: 0

Views: 111

Answers (1)

Budi Santoso
Budi Santoso

Reputation: 1

I don't know if it has the same way to solving the problem. But some time ago I encountered the same issue in my web flask app. I can't upload and update images to the database. Then I tried clearing the cache by flushing LSChache, restarting the detached PHP process (in LiteSpeed Web Cache Manager) and then restarting the Python application in the CPanel options menu. After that the issue was fixed.

Upvotes: 0

Related Questions