I deployed my Django project that uses Apache and MySQL. all apps features work fine, but in an application's views.py, when I try to access it, it raises this error.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 9735: ordinal not in range(128)
it works fine in localhost , my query contains some arabic character
I searched a lot but none of them works for me. The views.py
of the app has many queries (for calculating), annotate and aggregate
also Case(When())
?
this is my error.log
[Fri Aug 21 14:30:46.907352 2020] [wsgi:error] [pid 20969:tid 140683116439296] [remote 95.159.84.254:12151] File "/var/www/projectname/venv/lib/python3.6/site-packages/django/views/debug.py", line 94, in technical_500_response
[Fri Aug 21 14:30:46.907356 2020] [wsgi:error] [pid 20969:tid 140683116439296] [remote 95.159.84.254:12151] html = reporter.get_traceback_html()
[Fri Aug 21 14:30:46.907362 2020] [wsgi:error] [pid 20969:tid 140683116439296] [remote 95.159.84.254:12151] File "/var/www/projectname/venv/lib/python3.6/site-packages/django/views/debug.py", line 332, in get_traceback_html
[Fri Aug 21 14:30:46.907379 2020] [wsgi:error] [pid 20969:tid 140683116439296] [remote 95.159.84.254:12151] t = DEBUG_ENGINE.from_string(fh.read())
[Fri Aug 21 14:30:46.907387 2020] [wsgi:error] [pid 20969:tid 140683116439296] [remote 95.159.84.254:12151] File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
[Fri Aug 21 14:30:46.907391 2020] [wsgi:error] [pid 20969:tid 140683116439296] [remote 95.159.84.254:12151] return codecs.ascii_decode(input, self.errors)[0]
[Fri Aug 21 14:30:46.907402 2020] [wsgi:error] [pid 20969:tid 140683116439296] [remote 95.159.84.254:12151] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 9735: ordinal not in range(128)
[Fri Aug 21 14:30:50.086155 2020] [wsgi:error] [pid 20969:tid 140683116439296] [remote 95.159.84.254:12181] Not Found: /favicon.ico
[Fri Aug 21 11:36:30.228905 2020] [mpm_event:notice] [pid 20966:tid 140683347807168] AH00491: caught SIGTERM, shutting down
[Fri Aug 21 11:36:30.330450 2020] [mpm_event:notice] [pid 21882:tid 140691412487104] AH00489: Apache/2.4.29 (Ubuntu) mod_wsgi/4.5.17 Python/3.6 configured -- resuming normal operations
[Fri Aug 21 11:36:30.330585 2020] [core:notice] [pid 21882:tid 140691412487104] AH00094: Command line: '/usr/sbin/apache2'
[Fri Aug 21 12:15:09.336685 2020] [mpm_event:notice] [pid 21882:tid 140691412487104] AH00491: caught SIGTERM, shutting down
[Fri Aug 21 12:15:09.451585 2020] [mpm_event:notice] [pid 22113:tid 139983902116800] AH00489: Apache/2.4.29 (Ubuntu) mod_wsgi/4.5.17 Python/3.6 configured -- resuming normal operations
[Fri Aug 21 12:15:09.451973 2020] [core:notice] [pid 22113:tid 139983902116800] AH00094: Command line: '/usr/sbin/apache2'
[Fri Aug 21 12:51:39.616795 2020] [mpm_event:notice] [pid 22113:tid 139983902116800] AH00491: caught SIGTERM, shutting down
[Fri Aug 21 12:51:39.714991 2020] [mpm_event:notice] [pid 22639:tid 140292123478976] AH00489: Apache/2.4.29 (Ubuntu) mod_wsgi/4.5.17 Python/3.6 configured -- resuming normal operations
[Fri Aug 21 12:51:39.715191 2020] [core:notice] [pid 22639:tid 140292123478976] AH00094: Command line: '/usr/sbin/apache2'