Fixing upload of files with non-ASCII names in apache/mod_wsgi

One of the first things I do when configure new server for django/mod_wsgi/apache project is checking in which locale apache is started. I usually work with CentOS installations, where apache starts with “HTTPD_LANG=C” and that results in strange 500 errors(or Unicode errors deep in standart library, which is even more confusing) when uploading files with non-ASCII characters in name. This can be fixed by editing /etc/sysconfig/httpd file, uncommenting HTTPD_LANG variable and setting it to something like en_EN.UTF-8, after service httpd restart it’s possible to upload any files. (apachectrl restart wouldn’t work, you need to use service restart)



Leave a comment