I want to deploy multiple Django projects on one server. It is Windows 32 bit Xampp. mod_wsgi is 32 bit. python is 32 bit. Django is ver 1.7.3.
I have read lots of posts and tried many things but I can't get past this problem.
The following error shown in the browser also indicates some version info.
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
Error 500
localhost Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.19 mod_wsgi/3.5 Python/2.7.6
I can successfully deploy one django application this way. There are no errors if I only deploy one, for example c:/p2/xampp/htdocs/django/mysite
When I add the second project I get the below error and only the first project works.
I get the following error in the apache error.log.
mod_wsgi (pid=11184): Exception occurred processing WSGI script 'C:/p2/xampp/htdocs/django/apache/django161c.wsgi'.
~~~~~ some lines removed ~~~~~~
ImportError: Could not import settings 'mysite.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named mysite.settings
Last two lines of My httpd.conf:
LoadModule wsgi_module modules/mod_wsgi.so
Include C:/p2/xampp/htdocs/django/apache/wsgi3.conf
My wsgi3.conf
############
listen 8986
<VirtualHost *:8986>
Alias /static/ c:/p2/xampp/htdocs/django/mysite/static/
WSGIScriptAlias / "c:/p2/xampp/htdocs/django/apache/mysite.wsgi"
DocumentRoot "c:/p2/xampp/htdocs/django/mysite"
ServerName 127.0.0.1
<Directory "c:/p2/xampp/htdocs/django/apache">
Allow from all
</Directory>
</VirtualHost>
############
listen 8985
<VirtualHost *:8985>
WSGIScriptAlias / "c:/p2/xampp/htdocs/django/apache/django161c.wsgi"
DocumentRoot "c:/p2/xampp/htdocs/django/django161c"
ServerName 127.0.0.1
<Directory "c:/p2/xampp/htdocs/django/apache">
Allow from all
</Directory>
</VirtualHost>
My mysite.wsgi:
import os, sys
sys.path.append('c:/p2/xampp/htdocs/django/mysite')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
# works: https://www.pythonanywhere.com/forums/topic/1629/ # this is for changes to django 1.7 # 2015-01-23_Fri_14.13-PM
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
My django161c.wsgi
import os, sys
sys.path.append('c:/p2/xampp/htdocs/django/django161c')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Can you help me?