Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

A case of windows+apache+mod_python configuring a django runtime environment

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the case of windows+apache+mod_python configuration django operating environment, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

Environment: windows2008, apache2.2, python2.5, mod_python-3.3.1.win32-py2.5-Apache2.2, django-1.0.2_final

1. Create a mysite test site: django-admin.py startproject mysite

2. Create a test page: hello.py, with the following contents:

From django.http import HttpResponsedef index (request): return HttpResponse ('Hello, Djangover')

3. Create a mod_py_dj.conf configuration file as follows:

LoadModule python_module modules/mod_python_so.pyd Listen 8081 NameVirtualHost *: 8081 SetHandler python-program PythonPath "['d:\ open\ www'] + sys.path" PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE mysite.settings PythonAutoReload Off PythonDebug On

Note: in this VirtualHost, you do not need to configure DocumentRoot, otherwise it will be added as follows:

Options FollowSymLinks AllowOverride All Order allow,deny Allow from all

Do not configure DocumentRoot, less configuration.

4. Modify the url.py file and add a line:

(r'^ hello/$', 'mysite.hello.index')

5. Test, http://localhost:8081/hello/

Thank you for reading this article carefully. I hope the article "the case of windows+apache+mod_python configuring django running environment" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report