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 閱讀(600) 評論(1)  編輯  收藏

          評論

          # re: 最近學習Django遇到的幾個問題 2009-11-11 10:19 tonydon
          支持下,感謝分享:)  回復  更多評論
            


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 宜春市| 波密县| 四川省| 乐亭县| 巴林左旗| 庄河市| 合江县| 宝山区| 建始县| 祁东县| 涞源县| 亳州市| 南康市| 长沙县| 商城县| 崇明县| 绥中县| 阳高县| 蚌埠市| 赤峰市| 墨玉县| 营口市| 盐源县| 尤溪县| 蒙自县| 新乡市| 石景山区| 万宁市| 象山县| 会理县| 灵丘县| 江孜县| 陈巴尔虎旗| 罗江县| 平安县| 辽源市| 阿拉善盟| 曲靖市| 安泽县| 抚顺县| 三河市|