Differences between revisions 7 and 8
Revision 7 as of 2007-02-25 08:53:31
Size: 2417
Editor: limodou
Comment:
Revision 8 as of 2007-02-25 08:58:09
Size: 2417
Editor: limodou
Comment:
Deletions are marked like this. Additions are marked like this.
Line 32: Line 32:
 * [http://pygments.org/ pygments] 0.7.1 [http://pygments.org/media/pygmentsdocs.tar.gz Download]
 * [http://www.pythonware.com/products/pil/ PIL] 1.1.6
 * [http://pygments.org/ pygments] 0.6+ [http://pygments.org/media/pygmentsdocs.tar.gz Download]
 * [http://www.pythonware.com/products/pil/ PIL] 1.1.5+

lighttpd+fastcgi

准备

安装相关组件:

$sudo pkg_add -rv lighttpd
$cd /usr/ports/www/py-flup
$sudo make install clean
$cd /usr/ports/graphics/py-imaging
$sudo make install clean
...
===>   Registering installation for py24-imaging-1.1.5_2
===>  Cleaning for python24-2.4.3_3
===>  Cleaning for jpeg-6b_4
===>  Cleaning for freetype2-2.2.1_1
===>  Cleaning for libtool-1.5.22_2
===>  Cleaning for gmake-3.81_1
===>  Cleaning for pkg-config-0.21
===>  Cleaning for gettext-0.14.5_2
===>  Cleaning for libiconv-1.9.2_2
===>  Cleaning for py24-imaging-1.1.5_2

配置

相关模块:

Settings 说明

DATABASE_ENGINE = 'sqlite3'           # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_NAME = './database.db'             # Or path to database file if using sqlite3.
DATABASE_USER = ''             # Not used with sqlite3.
DATABASE_PASSWORD = ''         # Not used with sqlite3.
DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.

根据需要进行修改数据库的配置。

MEDIA_ROOT = 'media/'

在Apache上时应为绝对路径。如:/var/home/xxx/htdocs/media/,权限请设置正确,不行为777。

ROOT_URLCONF = 'openbook.urls'

注意,这里路径为openbook ,因此如果你的目录不是openbook ,则请修改成正确的路径。

SITE_MEDIA = './media'

在Apache上时应为绝对路径。如:/var/home/xxx/htdocs/media/,权限请设置正确,不行为777。

创建数据库

当settings.py设置完毕之后,可以先创建数据库。

python manage.py syncdb

对于sqlite3数据库要注意:

  • 数据库文件应为绝对路径
  • 注意数据库文件权限应可以读写,如 744

启动开发服务器进行测试:

python manage.py runserver

Apache 上 Fastcgi 的配置

  • django.fcgi
  • .htaccess

ObpLatform/2007-02-24 (last edited 2009-12-25 07:08:59 by localhost)