Hi, I'm trying to secure /site_media/private and /site_media/pictures so that only logged in users can see the files in those directories and below.
The error I'm getting (sometimes - seems to be a bit inconsistent) is [Fri Mar 28 09:39:06 2008] [error] [client XXX.XXX.XXX.XXX] PythonAuthenHandler django.contrib.auth.handlers.modpython: ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined., referer: http://site/private/pictures/ Here's my apache virtual host configuration (site name changed to site). Have I done anything obviously wrong? The PythonPath entries are indented correctly in the original. Thanks, Tim <VirtualHost *:80> ServerAdmin [EMAIL PROTECTED] ServerName www.site ServerAlias site DocumentRoot /home/tjs/web/site <Directory /home/tjs/web/site> Options -Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> <Directory /home/tjs/web/site/site_media> allow from all </Directory> CustomLog /home/tjs/log/site pink <Location "/site_media/pictures"> AuthType Basic AuthName "site" Require valid-user AuthBasicAuthoritative Off AuthzDefaultAuthoritative Off AuthzGroupFileAuthoritative Off AuthzUserAuthoritative Off SetEnv DJANGO_SETTINGS_MODULE site.settings PythonPath "['/home/tjs/web','/home/tjs/django/sorl-thumbnail-read-only','/home/tjs/django/django-trunk'] + sys.path" PythonAuthenHandler django.contrib.auth.handlers.modpython PythonOption DjangoRequireStaffStatus Off PythonOption DjangoPermissionName members.can_access_private_area </Location> <Location "/site_media/private"> AuthType Basic AuthName "site" Require valid-user AuthBasicAuthoritative Off AuthzDefaultAuthoritative Off AuthzGroupFileAuthoritative Off AuthzUserAuthoritative Off SetEnv DJANGO_SETTINGS_MODULE site.settings PythonPath "['/home/tjs/web','/home/tjs/django/sorl-thumbnail-read-only','/home/tjs/django/django-trunk'] + sys.path" PythonAuthenHandler django.contrib.auth.handlers.modpython PythonOption DjangoRequireStaffStatus Off PythonOption DjangoPermissionName members.can_access_private_area </Location> <Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE site.settings PythonDebug Off PythonPath "['/home/tjs/web','/home/tjs/django/sorl-thumbnail-read-only','/home/tjs/django/django-trunk'] + sys.path" </Location> <Location "/media"> SetHandler None </Location> <Location "/site_media"> SetHandler None </Location> </VirtualHost> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---