[django]使用 nginx + fastcgi 部署 django

本文测试环境:linux mint,python 2.7,django 1.4

安装依赖

安装 flup:

$ sudo pip install flup

安装 nginx

$ sudo apt-get install nginx

设置 django

本例中项目名为 bbs:

$ pwd
/var/www/bbs

$ tree . -d
.
|-- bb  # 应用
|-- bbs  # settings.py wsgi.py
|-- static  # 静态文件
|   `-- css
`-- templates  # TEMPLATE_DIRS

配置 settings:

TEMPLATE_DIRS = (
    '/var/www/bbs ...
more ...

修改 pelican 3.1 使之支持中文文件夹作为分类目录

前提:

windows + pelican 3.1 + python 2.6
并且 pelican 配置文件中设置了 USE_FOLDER_AS_CATEGORY = True(默认为 True,只要不设置为 False 即可)

默认情况下,pelican 不支持中文文件夹作为分类目录:

d:\myblog>pelican content -o output -s pelicanconf.py -D
...

CRITICAL: 'utf8' codec can't decode byte 0xd3 in position 2: invalid continuation byte
Traceback (most recent call last ...
more ...