标题:
linux Python_mod django安装文档,挺有用的分享下!![分享]
[打印本页]
作者:
python达人
时间:
2012-9-24 11:15
标题:
linux Python_mod django安装文档,挺有用的分享下!![分享]
linux Python_mod django安装文档,挺有用的分享下!![分享]
Python2.4安装文档
#rpm -e python --nodeps
#tar -zxvf Python-2.4.2.tgz9
#./configure
#make
#make install
#vi /etc/profile
复制代码
export PYTHONHOME=/usr/local
export PYTHONPATH=/usr/local/lib/python2.4
export PATH=$PATHPYTHONHOME
复制代码
Python_mod安装文档
#gzip mod_python-3.1.4.tar
#tar -zxvf mod_python-3.1.4.tar.gz
#cd mod_python-3.1.4
#./configure --with-apxs=/usr/local/apache/bin/apxs
#make
#su
#make install
#vi /usr/local/apache/conf/httpd.conf
复制代码
添加oadModule python_module modules/mod_python.so
<Directory /usr/local/apache/htdocs/python>
AddHandler mod_python .py
PythonHandler index
PythonDebug On
</Directory>
#cd /usr/local/apache/htdocs/python
vi index.py
view plaincopy to clipboardprint?
from mod_python import apache
def handler(req):
req.write("Hello World!")
return apache.OK
from mod_python import apache
def handler(req):
req.write("Hello World!")
return apache.OK
复制代码
安装Django文档
Install Mysql-pythong
#tar -zxvf MySQL-python-1.2.0.tar.gz
#cd MySQL-python-1.2.0
#python setup.py build
#su
#python setup.py install
Install Django
#tar xzvf Django-0.91.tar.gz
#cd Django-0.91
#sudo python setup.py install
#vi httpd.conf
<Directory /usr/local/apache/htdocs/python>
SetHandler python-program
PythonPath "['/usr/local/apache/htdocs/python'] + sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE newtest.settings
PythonDebug On
</Directory>
复制代码
本文源自:http : / /www.csvt. net/
欢迎光临 编程开发论坛 (http://bbs.lihuasoft.net/)
Powered by Discuz! 6.0.0