On 05/01/06 22:36, tgone wrote:
> Hello,
> 
> I followed the tutorial on how to serve static files with
> Apache+mod_python but I'm still having problems. I get a 404 when I try
> to access an image at http://localhost/project/media/test.png. I know
> for sure that mod_python is disabled for the /media/ dir, but I can't
> get the images to display.
> 
> Here is my httpd.conf:
> 
> ----------------------------------------------------------------------------------------------------
> <Location "/project">
>     SetHandler python-program
>     PythonHandler django.core.handlers.modpython
>     PythonPath "['/home/webadmin'] + sys.path"
>     SetEnv DJANGO_SETTINGS_MODULE project.settings
>     PythonDebug On
> </Location>
> 
> <Location "/project/media/">
>     SetHandler None
> </Location>
> ----------------------------------------------------------------------------------------------------
> 
> Here is my settings.py
> ----------------------------------------------------------------------------------------------------
> MEDIA_ROOT = '/home/webadmin/project/media/'
> MEDIA_URL = 'http://localhost/project/media/'
> ADMIN_MEDIA_PREFIX = '/project/media/'
> ----------------------------------------------------------------------------------------------------
> 
> I've double checked my MEDIA_ROOT and my image is there.
> 

You haven't told Apache where your media folder is.

Try something like:

Alias /project/media /home/webadmin/project/media/
<Directory /home/webadmin/project/media>
   SetHandler None
</Directory>

hth

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to