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

The method of configuring django running Environment by windows+apache+mod_python

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to configure django running environment with windows+apache+mod_python". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "windows+apache+mod_python configuration django runtime environment method" it!

Environment: windows2008,apache2.2,python2.5,mod _ python-3. 3. 1. Win32-py 2.5-Apache 2.2 century djangomuri 1.0.2 final

1. The option test site created: django-admin. Py launches the project my website

2. Create a test page: Hello, py, the content is as follows:

From Django. Httproporthtpresponse

Defindex (request):

ReturnHttpResponse ('Hello, Django')

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

Loadmoduletype son _ modules/mod _ python _ so . Pyridinoline

List 8081

Name virtual host *: 8081

VirtualHost*:8081

Location'/'

SetHandlerpython- program

Python path'['d:\ open\ www'] sys. "path"

Python handlerDjango . The core. The person who handled it. Mod python

SetEnvDJANGO _ SETTINGS _ Modulemysite . Environment

Python onautoreloadoff

Python ondebugon

/ location

/ VirtualHost

Note: there is no need to configure DocumentRoot in this virtual host, otherwise it will be added as follows:

Directory d:\ open\ www'

Option tracking symbolic link

AllowOverrideAll

Orderallow,deny

Allowfromall

/ directory

Do not configure DocumentRoot, less configuration.

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

(r'^ hello/$', "my website. Hello. Index")

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

At this point, I believe that you have a deeper understanding of "the method of windows+apache+mod_python configuring django running environment". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue 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

Internet Technology

Wechat

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

12
Report