zoukankan      html  css  js  c++  java
  • django+httpd+mod_pythonurl存在中文路径问题解决

    djangobook
    If you get a UnicodeEncodeError
    If you're taking advantage of the internationalization features of Django (seeInternationalization) and you intend to allow users to upload files, you mustensure that the environment used to start Apache is configured to acceptnon-ASCII file names. If your environment is not correctly configured, youwill trigger UnicodeEncodeError exceptions when calling functions likeos.path() on filenames that contain non-ASCII characters.
    To avoid these problems, the environment used to start Apache should containsettings analogous to the following:
    export LANG='en_US.UTF-8'

    export LC_ALL='en_US.UTF-8'

    Consult the documentation for your operating system for the appropriate syntaxand location to put these configuration items; /etc/apache2/envvars is acommon location on Unix platforms. Once you have added these statementsto your environment, restart Apache.
      

    1.在ubuntulinux中只需修改/etc/apache2/envvars
    在redhat中不存在那个文件那么在/etc/profile添加上相应内容即可。
    2.重启apache服务。

  • 相关阅读:
    js里面的 InttoStr 和 StrtoInt
    预编译知识 (转载记录)
    C语言操作内存
    C语言操作文件
    C语言
    如何调试shell脚本
    设计模式-装饰者模式
    自己动手制作一个模版解析
    设计模式-单例模式
    http中关于缓存的那些header信息
  • 原文地址:https://www.cnblogs.com/baoyiluo/p/2863043.html
Copyright © 2011-2022 走看看