Django和PHP同时使用 [英] Django and PHP simultaneous use
问题描述
我有一个支持 PHP
的 Apache
服务器.我还用 mod_wsgi
和 mysql-connector
安装了 Python
.此外,我安装了Django.现在,我想尝试在服务器端同时使用 PHP
和 Python
.问题是,我与 PHP
一起工作了几年,我发现它越来越流行了,所以我计划将我的一些PHP代码移植到Python代码,或者只是尝试一下,看看他们如何一起工作.因此,我现在有一个位于 C:\ Apache \ htdocs
的站点,并在 C:\ WebPython \ djsite
上创建了第一个 Django
项目.在 djsite
内部,我有 djsite
文件夹和四个文件 _init_.py,settings.py,urls.py和wsgi.py
.在我的站点中,我想同时处理PHP处理程序(或脚本)和Python脚本,因此,我想问题在于如何配置 httpd.conf
.我在这里通过stackoverflow和外部浏览了许多论坛线程,但仍然无法正常工作.现在,我的httpd.conf看起来像这样:
I have an Apache
server with PHP
support. I also installed Python
with mod_wsgi
and with mysql-connector
. Besides I installed Django. Now, I want to try to use PHP
and Python
simultaneously at the server side. The catch is, I worked with PHP
for a couple of years and I see that it is becoming less and less popular, so I plan to port some of my PHP-code to Python-code, or just to try it, to see how they work together. So, I now have a site located at C:\Apache\htdocs
and I created a first Django
project at C:\WebPython\djsite
. Inside djsite
I have djsite
folder and four files _init_.py, settings.py, urls.py and wsgi.py
. In my site I want to address both to PHP handlers (or scripts) and to Python scripts, so, I guess, the problem is in how to config httpd.conf
. I looked through many forum threads here at stackoverflow and outside, but still I can't make it work. Now, my httpd.conf looks like this:
...
ServerName localhost
<Directory "c:/Apache/htdocs">
Options Indexes FollowSymLinks
</Directory>
<IfModule dir_module>
DirectoryIndex index.html index.htm index.php
</IfModule>
...
推荐答案
您应该看到以下问题:
它有一个链接:
http://animuchan.net/django_php/
在Django上运行PHP会很麻烦.
Running PHP with Django would be a mess though.
这篇关于Django和PHP同时使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!