Sealyu

--- 博客已迁移至: http://www.sealyu.com/blog

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  618 随笔 :: 87 文章 :: 225 评论 :: 0 Trackbacks
1、基于IIS架构Django
具体方法可以参见http://code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer
PyISAPIe:http://pyisapie.sourceforge.net/
PyISAPIe包中的Django有点问题,需要在Django/Isapi.py添加以下代码:
    import sys
    sys.path.append("d:/webpath")
    
在pyisapie.py的“PyISAPIeRequest.__init__” 中加入"This.method = Env.REQUEST_METHOD"
这样就可以正常运行了,演示站点(IIS+Python+PyISAPIe+Django):http://django.sxia.net
问题:现在好像还不支持多站点。

2、在Django Admin中加入FCKeditor
class Admin:
js = ['FCKeditor/fckeditor.js', 'js/fckeditor.js']

js/fckeditor.js代码如下:(通用)
window.onload = function(){
  var nodeList = document.getElementsByTagName("textarea");
  for (var i=0; i<nodeList.length; i++) {
    var elm = nodeList.item(i);
    var oFCKeditor = new FCKeditor( elm.id ) ; 
    oFCKeditor.Height = 300;
    oFCKeditor.BasePath = "/media/FCKeditor/" ; 
    oFCKeditor.ReplaceTextarea() ; 
  }
}

3、基于APACHE架构Django
httpd.conf文件配置:
LoadModule python_module modules/mod_python.so

<Location "/">
    SetHandler python-program
    PythonPath "['d:\website'] + sys.path"
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE PROJECT.settings
    PythonDebug On
</Location>

Alias /media C:\Python24\Lib\site-packages\django\contrib\admin\media
<Location "/media">
    SetHandler None
</Location>
posted on 2008-09-16 22:20 seal 阅读(577) 评论(1)  编辑  收藏

评论

# re: 最近学习Django遇到的几个问题 2009-11-11 10:19 tonydon
支持下,感谢分享:)  回复  更多评论
  


只有注册用户登录后才能发表评论。


网站导航: