Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.0.X] Fixed #10426 -- Added note on language variables required for…

… Apache to survive non-ASCII file uploads. Thanks to daybreaker for the report, and david for the draft text.

Merge of r11170 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@11172 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 40f24b46357ec486487c50898185ff5caa2e46e2 1 parent c05f4d5
Russell Keith-Magee authored July 03, 2009

Showing 1 changed file with 23 additions and 2 deletions. Show diff stats Hide diff stats

  1. 25  docs/howto/deployment/modpython.txt
25  docs/howto/deployment/modpython.txt
@@ -6,8 +6,8 @@ How to use Django with Apache and mod_python
6 6
 
7 7
 .. highlight:: apache
8 8
 
9  
-The `mod_python`_ module for Apache_ can be used to deploy Django to a 
10  
-production server, although it has been mostly superseded by the simpler 
  9
+The `mod_python`_ module for Apache_ can be used to deploy Django to a
  10
+production server, although it has been mostly superseded by the simpler
11 11
 :ref:`mod_wsgi deployment option <howto-deployment-modwsgi>`.
12 12
 
13 13
 mod_python is similar to (and inspired by) `mod_perl`_ : It embeds Python within
@@ -378,3 +378,24 @@ as necessary.
378 378
 .. _Expat Causing Apache Crash: http://www.dscpl.com.au/articles/modpython-006.html
379 379
 .. _mod_python FAQ entry: http://modpython.org/FAQ/faqw.py?req=show&file=faq02.013.htp
380 380
 .. _Getting mod_python Working: http://www.dscpl.com.au/articles/modpython-001.html
  381
+
  382
+If you get a UnicodeEncodeError
  383
+===============================
  384
+
  385
+If you're taking advantage of the internationalization features of Django (see
  386
+:ref:`topics-i18n`) and you intend to allow users to upload files, you must
  387
+ensure that the environment used to start Apache is configured to accept
  388
+non-ASCII file names. If your environment is not correctly configured, you
  389
+will trigger ``UnicodeEncodeError`` exceptions when calling functions like
  390
+``os.path()`` on filenames that contain non-ASCII characters.
  391
+
  392
+To avoid these problems, the environment used to start Apache should contain
  393
+settings analogous to the following::
  394
+
  395
+    export LANG='en_US.UTF-8'
  396
+    export LC_ALL='en_US.UTF-8'
  397
+
  398
+Consult the documentation for your operating system for the appropriate syntax
  399
+and location to put these configuration items; ``/etc/apache2/envvars`` is a
  400
+common location on Unix platforms. Once you have added these statements
  401
+to your environment, restart Apache.

0 notes on commit 40f24b4

Please sign in to comment.
Something went wrong with that request. Please try again.