Hello for everyone.

I have here a environment based on Apache, mod_wsgi and WSGIHandler for
Django.

Sometimes we get a really unusual problem - a blank screen - when we access
django applications via Apache.
Here is my Apache configuration for virtual host with Django application:

# File: myapp-develop.conf
-----------------------------------------------------------------------------------------------------------------------------------------
SetEnv PYTHONPATH
"/home/felipe.prenholato/django-related/python-libs/lib/python2.5/:/home/felipe.prenholato/django-related/python-libs/lib/python2.5/site-packages/"
<VirtualHost *:80>
    ServerAdmin felipe.prenhol...@myhost.com
    ServerName myapp-develop.myhost.com.br
    ServerAlias myapp-develop.myhost.com
    ServerAlias myapp-develop.intranet
    DocumentRoot /www/myapp-develop/www/
    <Directory /www/myapp-develop/www/>
        Options +Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    AddDefaultCharset utf-8
    AddCharset utf-8 .txt .html .htm .py .pt .pty
    CustomLog /www/myapp-develop/log/access.log combined
    ErrorLog /www/myapp-develop/log/error.log
    LogLevel debug
    ServerSignature On
    ####### WSGI configuration #######
    WSGIScriptAlias / /www/myapp-develop/myapp/wsgi_handler/django.wsgi
    <Directory /www/myapp-develop/myapp/wsgi_handler>
        Order allow,deny
        Allow from all
    </Directory>
    Alias /media /www/myapp-develop/myapp/media/
    <Directory "/www/myapp-develop/myapp/media/">
        Order allow,deny
        Options Indexes
        Allow from all
        IndexOptions FancyIndexing
    </Directory>
    Alias /admin/media/
"/usr/lib/python2.5/site-packages/django/contrib/admin/media/"
    <Directory
"/usr/lib/python2.5/site-packages/django/contrib/admin/media/">
        Order allow,deny
        Options Indexes
        Allow from all
        IndexOptions FancyIndexing
    </Directory>
    Alias /favicon.ico "/www/myapp-develop/myapp/media/favicon.ico"
</VirtualHost>
# End of file: myapp-develop.conf
-----------------------------------------------------------------------------------------------------------------------------------------

And here my WSGI Script:

# File: /www/myapp-develop/myapp/wsgi_handler/django.wsgi
-----------------------------------------------------------------------------------------------------------------------------------------
# -*- coding: utf-8 -*-
import os, sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'myapp.settings'

# adding system paths, ex, django directory and django additional tools ->
['path1','path2','path3']
path =
['/home/felipe.prenholato/django-related/python-libs/lib/python2.5/site-packages/','/home/felipe.prenholato/django-related/python-libs/lib/python2.5/site-packages/django_form_utils-0.2.0pre-py2.5.egg/']
path.reverse()
for e in path:
    sys.path.insert(0,e)

# adding project paths
sys.path.append('/www/myapp-develop/')
sys.path.append('/www/myapp-develop/myapp/')

import django
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()
sys.stdout = sys.stderr

"""def application(environ, start_response):
    status = '200 OK'
    output = '\n'.join(sys.path)
    output += '\n%s' % django.__path__
    output += '\n%s' % dir(WSGIHandler)
    response_headers = [('Content-type', 'text/plain'),
            ('Content-Length', str(len(output)))]
    start_response(status, response_headers)
    return [output]"""
# End of file: /www/myapp-develop/myapp/wsgi_handler/django.wsgi
-----------------------------------------------------------------------------------------------------------------------------------------

More details:

I run Django SVN from my home directory, but, when I run with django stable
from normal path (site-packages in /usr/lib) I get same problem.

If I uncomment application method in django.wsgi file I get right output of
method, if not, my screen continue blank. Because it I think that is some
problem on Django WSGI Handler.

I only solve problem restarting Apache.

My Linux server is a Fedora Core 9 with kernel 2.6.26.6-79.fc9.i686.PAE and
SMP.
My Apache version is Apache 2.2.9, my mod_wsgi version is 2.1, ast provided
by FC9 ... We have 2.3 in FC10 but my system administrator not want to touch
in this update for now, and in modwsgi.org we have 2.5, but, yet, my
sysadmin not want to touch in updates in server ...

This dev server have more than 1000 Virtual Hosts, but I don't think that it
is relevant.

So people, with this data, which may be the problem?
I really need help on this :\

Thx in advance!

-- 
Felipe 'chronos' Prenholato.
Linux User nÂș 405489
Home page: http://chronosbox.org/blog

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to