Both mod_wsgi and TurboGears contain specific notes about this issue with Python eggs when using Python running inside of Apache.
In mod_wsgi documentation read section on 'Access Rights Of Apache User' in: http://code.google.com/p/modwsgi/wiki/ApplicationIssues In TurboGears documentation read section headed 'The general stuff' in: http://docs.turbogears.org/1.0/mod_python When using mod_python as you are, probably the only way to get around the problem without changing the startup scripts for Apache is to use the mod_python PythonImport directive to import, at startup of each Apache child process, into the same Python interpreter as your Django application is running, a module which sets the PYTHON_EGG_CACHE environment variable. Ie., the module imported using PythonImport should say: import os os.environ['PYTHON_EGG_CACHE'] = '/some/directory' Where '/some/directory' is a directory writable by the user that Apache runs as. Graham On Apr 24, 4:15 pm, [EMAIL PROTECTED] wrote: > Hi, > > I have a django site that just launched usingmod_python, apache2, and > redhat. It's a medium sized site, everything worked great for a couple > days, yesterday I suddenly got error after error in my apache logs > such as the ones below. This happens even though there are no code > changes. The site stays down until I restart reload apache and the > site works again. But today the site went down and I got very similar > errors. The old site used to have different urls, could people/bots > trying to retrieve old urls be confusing django? > > Thanks, any help would be greatly appreciated, > > Leon > > [Mon Apr 23 19:09:18 2007] [error] [client 66.249.65.230] > PythonHandler django.core.handlers.modpython: ExtractionError: Can't > extract file(s) to egg cache\n\nThe following error occurred while > trying to extract file(s) to the Python egg\ncache:\n\n [Errno 13] > Permission denied: '/.python-eggs'\n\nThe Python egg cache directory > is currently set to:\n\n /.python-eggs\n\nPerhaps your account does > not have write access to this directory? You can\nchange the cache > directory by setting the PYTHON_EGG_CACHE environment\nvariable to > point to an accessible directory.\n > > [Mon Apr 23 19:11:31 2007] [error] [client 24.215.224.50] > PythonHandler django.core.handlers.modpython: File "/usr/lib/ > python2.3/site-packages/django/core/handlers/base.py", line 35, in > load_middleware\n raise exceptions.ImproperlyConfigured, > 'Middleware module "%s" does not define a "%s" class' % (mw_module, > mw_classname) > [Mon Apr 23 19:11:31 2007] [error] [client 24.215.224.50] > PythonHandler django.core.handlers.modpython: ImproperlyConfigured: > Middleware module "django.contrib.sessions.middleware" does not define > a "SessionMiddleware" class --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---