1: Install mod_wsgi: Download mod_wsgi.so and put it in the modules (in the Apache installation path) folder.
: Http://www.lfd.uci.edu /~ Gohlke/pythonlibs/# mod_wsgi
** Note: Remember when selecting: The mod_wsgi-3.5.ap22.win32-py3.3.zip refers to the corresponding apache version is 22, Win32 is not the number of your system, but the number of Apache. You can see in the logs folder that python is version 3.3.
Find the loadmodule in the Apache configuration file (CONF/httpd. conf) and add:
Loadmodule wsgi_module modules/mod_wsgi.so
The preliminary configuration of Apache is successful. Start the browser and enter http: 127.0.0.1: 80. The first step is successful. Congratulations! proceed to the next step.
2. There is a wsgi. py file under proj (project), which is used for configuration.
The content is:
# The green part does not exist in wsgi. py. We need to add it.
Import OS
Import sys
From Django. Core. wsgi import get_wsgi_application
SYS. Path. append (r 'e: \ project \ proj ') # Put the project path here
SYS. Path. append (r'e: \ project \ proj \ searchapp') # Put the application path here
OS. Environ. setdefault ("django_settings_module", "proj. Settings ")
Application = get_wsgi_application ()
3 In HTTP. conf: Write
Wsgiscriptalias/"E:/project/proj/wsgi. py" # This path is the absolute path of your wsgi. py file.
Note: The '/' in the middle is indispensable; otherwise, an error is reported.
Django + mod_wsig + Apache build production environment