I've got a server with Apache and I must start website designed in Django. I user mod_wsgi. Now I've it prepared. However the respond of the server is empty. As well as in error log, there's nothing. Are you aware what is why?

If some file may help (*.wsgi, configurations.py) I'll append it.


import os
import sys
import site

os.environ['PYTHON_EGG_CACHE'] = '/home/prochazky/venv/.python-eggs'


os.environ['DJANGO_SETTINGS_MODULE'] = 'Prochazky.settings'


import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

Apache vhost:

<VirtualHost *:80>
    WSGIScriptAlias / /home/prochazky/Prochazky/Prochazky.wsgi
    ServerName testing.prochazky.net
    DocumentRoot /home/prochazky

    ErrorLog /home/prochazky/wsgi.log

Trying obtaining a hello world program working first and never Django. Watch:


and browse:


In a guess though, are you currently possibly loading mod_python in to the same Apache. An incompatible mod_python may cause just that symptom with basically a segmentation fault message in primary Apache error log.


Are you currently loading mod_php into same Apache? It may sometimes have conflicting shared library needs and can result in a crash. If you're also loading it, disable it from Apache configuration.

Likewise try setting:

WSGIApplicationGroup %{GLOBAL}

This can pressure utilization of primary interpreter that will avoid issues with 3rd party extensions that are not written correctly to operate in sub interpreters.

You actually though may need to look more carefully in the primary Apache error log, not the virtual host one. Operate a 'tail -f' onto it whenever you create a request and appearance without a doubt you're seeing messages there, particularly a segmentation fault or similar message. This type of message about process crashes and leading to empty page won't show in virtual host error log.

Is it feasible web site file your root url/view is empty or examines to empty?

For example, for those who have a template like so:

{% extends "base.html" %}
{% block content %}blah blah{% endblock %}

and base.html does not make use of a block "content", then your content block out of your template will not be utilized as well as your template will evaluate to empty despite getting content.

This really is from the setup (names changed to safeguard the innocent guilty).

<VirtualHost *:80>
        ServerName site.domain.com 
        ServerAdmin webmaster@domain.com 

        WSGIScriptAlias / /home/user/site/django.wsgi

        <Directory /home/user/site/>
                Options FollowSymLinks
                AllowOverride None 
                Order allow,deny
                allow from all
         ... etc etc etc.

I want the <directory> to permit the server to gain access to the .wsgi.
I am not really an apache guru though so do not take this situation as perfect. (I believe all that's needed may be the order Allow, deny and allow from all)

a great site to look at: http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango