Question

I have this configuration in at the end of my httpd.conf:

<Location "/">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE myapp.settings
    PythonOption django.root /
    PythonDebug On
    PythonPath "['/my/path] + sys.path"

</Location>

This allows my application to startup, but the static files are not being served. I was thinking of adding something like this:

<Location "/site_media">
    # what to add here?
</Location>

And tell Apache to serve files from /site_media/... from /my/path/myapp/media. However, I cannot find a way to make the connection between /site_media and the actual path to my media directory. Could you guide me?

EDIT: I added this to httpd.conf:

Alias /site_media /my/path/myapp/media

<Directory /my/path/myapp/media>
    Order allow,deny
    Allow from all
</Directory>

<Location "/site_media">
</Location>

But, Apache still gives me 404 errors. I also tried to add a SetHandler None inside the /site_media/ location element, but I still receive the same 404 error codes.

Was it helpful?

Solution

Alias, but read the full section.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top