Hi,
I have a problem to configure my server with apache mod_wsgi and
django...
On my server I have:
linux kernel 2.6.27
python 2.6-2
apache 2.2.10 (Prefork)
mod_wsgi 2.3-1
django SVN-9538
My djangosite is in /dati/www/geminiweb/ inside this folder I put my
wsgi_handler.py
#=========================
# /dati/www/geminiweb/wsgi_handler.py
#=========================
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
os.environ['DJANGO_SETTINGS_MODULE'] = 'geminiweb.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
I link the geminiweb folder in /srv/http/ where is set my DocumentRoot
for apache server.
Then I have added to the apache configuration file this text:
#=========================
# from httpd.conf
#=========================
<VirtualHost *>
ServerName gemini.ing.unitn.it:8080
Alias /admin_media /usr/lib/python2.6/site-packages/django/contrib/admin/media
<Location /admin_media>
Order allow,deny
Allow from all
</Location>
Alias /media /srv/http/geminiweb/site-media
<Location /media>
Order allow,deny
Allow from all
</Location>
WSGIScriptAlias / /srv/http/geminiweb/wsgi_handler.py
WSGIDaemonProcess gemin user=pietro group=http processes=1 threads=10
WSGIProcessGroup gemin
</VirtualHost>
Now If I start the apache server and try to connect with a browser, I
recive back this error:
#=========================
# browser error
#=========================
"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.
If you think this is a server error, please contact the webmaster.
Error 500"
And if I look to the apache log error file
#=========================
# /var/log/httpd/error_log
#=========================
[Mon Dec 01 15:05:24 2008] [error] [client 87.13.14.62] mod_wsgi
(pid=15252): Exception occurred processing WSGI
script '/srv/http/geminiweb/wsgi_handler.py'.
[Mon Dec 01 15:05:24 2008] [error] [client 87.13.14.62] Traceback (most
recent call last):
[Mon Dec 01 15:05:24 2008] [error] [client 87.13.14.62]
File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py",
line 228, in __call__
[Mon Dec 01 15:05:24 2008] [error] [client 87.13.14.62]
self.load_middleware()
[Mon Dec 01 15:05:24 2008] [error] [client 87.13.14.62]
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py",
line 40, in load_middleware
[Mon Dec 01 15:05:24 2008] [error] [client 87.13.14.62] raise
exceptions.ImproperlyConfigured, 'Error importing
middleware %s: "%s"' % (mw_module, e)
[Mon Dec 01 15:05:24 2008] [error] [client 87.13.14.62]
ImproperlyConfigured: Error importing middleware
account.middleware: "No module named account.middleware"
But if I try to load account.middleware module from the django shell I
don't have any error...
#=========================
# django shell
#=========================
$ python manage.py shell
Python 2.6 (r26:66714, Oct 27 2008, 10:50:31)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from account import middleware
>>>
Somebody could tell me where is my error?
Any Hints?
Thanks for your help!
Pietro
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---