views:

116

answers:

2

I have set django.root to the root path in the url after the slash. But I want to have a download dialog in a subfolder of the root url which should not be accessed by urls.py. Is there any possibility to avoid access on urls.py and use instead the location of the apache configuration. Sorry, but this problem is very tricky and I hope you can understand my problem.

Thanks and greetz, thopil

+1  A: 

AutomatedTester is correct, this is more a Apache configuration than a programming question.

Anyway, it depends on how your django code is executed (mod_python, mod_wsgi). Usually, an Apache Alias would do the trick (that's how I am doing it with mod_wsgi). For example:

Alias /download /path/to/non-django/download/code

Hope this helps.

Haes
In case some says you need it, should be highlighted that for mod_wsgi you do not need 'SetHandler None' as you do with mod_python.
Graham Dumpleton
A: 

Since you tagged it with mod-python, it's obviously your deployment method. Read the related docs.

The tl;dr version:

<Location "/media">
    SetHandler None
</Location>
SmileyChris
This will only work as is if there is a 'media' directory under DocumentRoot for that virtual host. Otherwise, you need to also have an Alias directive mapping '/media' to where files actually reside.
Graham Dumpleton