1

I'm trying to deploy a Django app in production, on an apache server, using mod-wsgi. mod-wsgi is installed and working fine. When I run the Django server, it launches fine, but I can't access it on the server or online, and I don't understand why. I'm posting the relevant section of ports.conf (for apache), and my wsgi.py (automatically generated as pinax.wsgi when I created my project, renamed to wsgi.py, this does not affect anything) script below.

ports.conf:

<VirtualHost *:80>
ServerName <myserver>.org

WSGIDaemonProcess mysite python-path=/<myapp>-env/pinax-env/lib/python2.5/site-packages
WSGIProcessGroup mysite

WSGIScriptAlias / /<myapp>/deploy/wsgi.py
<Directory /<myapp>/deploy>
  Order deny,allow
  Allow from all
</Directory>
</VirtualHost>

wsgi.py

# pinax.wsgi is configured to live in projects/<myapp>/deploy.

import os
import sys

from os.path import abspath, dirname, join
from site import addsitedir

sys.path.insert(0, abspath(join(dirname(__file__), "../../")))

From django.conf import settings
os.environ["DJANGO_SETTINGS_MODULE"] = "<myapp>.settings"

sys.path.insert(0, join(settings.PROJECT_ROOT, "apps"))

from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()
1
  • 2
    You forgot to tell us what the problem is. What happens when you try to access it? Do you get an error? If so, what error? Oct 9, 2011 at 17:16

0

You must log in to answer this question.

Browse other questions tagged .