I am currently studying whether Python and Django are suitable for a project that I will be working on (so far this looks good). As a testing tool, I want python to work on a real server (apache2 on ubuntu) using mod_wsgi, but I just can't get it to work. Here is my httpd.conf (located in / etc / apache 2 / httpd.conf):
WSGIScriptAlias /test/tc-test/ /var/www/stage/hello/tc-test/django.wsgi
WSGIPythonPath /var/www/stage/test/tc-test/
<Directory /var/www/stage/test/tc-test>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
My django.wsgi is as follows:
import os
import sys
sys.path.append('/var/www/stage/test/tc-test')
os_environment['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
The URL for this directory will be http://stage.website.com/test/tc-test
, Apache, 500 . , . apache, - . WSGIScriptAlias WSGIPythonPath: , 500 , - , . , mod_wsgi , , , , - , . , . ?