5👍
also add to django.wsgi:
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
simple sys.setdefaultencoding(‘utf-8’) will not help, reload is important
This is python 2.x problem, not the django
0👍
Debian doesn’t I believe use ‘/etc/apache2/envvars’. Setting these values from inside of the Python script will not work as it will not initialise some things that only occur at process startup.
You either need to set the variables in the init.d startup script for Apache if envvars not consulted, or use mod_wsgi 3.4 and use daemon mode, setting the ‘lang’ and ‘locale’ options to WSGIDaemonProcess directive.
- [Django]-How to set User in request.user in Django using MongoDB
- [Django]-Graphene-Django nested filters (relay)
- [Django]-How to organize REST-API versioning the right way?
- [Django]-Django return foreign key object from queryset?
- [Django]-Django : extract a path from a full URL
Source:stackexchange.com