Re: Controlling File Downloads.

2010-12-15 Thread Matteius
Please check the classcomm project for how to do this. We determined the best/fastest approach would be to use Apache mod_auth_token and generate secure URLs using a custom template tag. You can find code and instructions for how to do that @ http://classcomm.googlecode.com/ and across the Interne

Re: Controlling File Downloads.

2010-12-15 Thread euan.godd...@googlemail.com
If you're using apache you might want to consider wiring your app to generate mod_auth_token URLs and have apache receive these. On Dec 15, 8:29 am, NoviceSortOf wrote: > What is the best way to allow authorized downloads > to specific users in Django. > > We have 2 possible scenarios that could

Controlling File Downloads.

2010-12-15 Thread NoviceSortOf
What is the best way to allow authorized downloads to specific users in Django. We have 2 possible scenarios that could work for us. 1. A download directory where any user can download any file in the folder. or 2. Granting specific rights to specific users to download a specific file or se

HttpResponse error with file downloads

2007-07-27 Thread Patrick Anderson
Recently I've encountered the following error: -- Traceback (most recent call last): File "/usr/local/lib/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch default=default_handler, arg=req, si

Re: File downloads

2006-12-03 Thread Graham Dumpleton
marksibly wrote: > Found it in the FAQ; > [quote] > If you're using mod_python but not using Django's request handler, > you'll need to work around a mod_python bug related to the use of > SetEnv; before you import anything from Django you'll need to do the > following: > > os.environ.update(req.s

Re: File downloads

2006-12-03 Thread marksibly
Found it in the FAQ; [quote] If you're using mod_python but not using Django's request handler, you'll need to work around a mod_python bug related to the use of SetEnv; before you import anything from Django you'll need to do the following: os.environ.update(req.subprocess_env) [/quote] --~--~

Re: File downloads

2006-12-03 Thread marksibly
Hi, Thanks for that! Another option I've found is to use mod_python's 'sendfile()' method in req. However, I'm having a problem using Django within a 'plain' mod_python handler - I get the 'DJANGO_SETTINGS_MODULE' not found error as soon as I try to import my models. I've copied the apache co

Re: File downloads

2006-12-03 Thread Ivan Sagalaev
marksibly wrote: > I couldn't find a 'HttpResponseStaticFile' class or anything, so what > other options do I have? You can pass an open file to a usual HttpResponse: f = open(filename, 'rb') return HttpResponse(f, mimetype='application/octet-stream') > Also, how efficient would it be

File downloads

2006-12-03 Thread marksibly
Hi, I have a django 'files' app that simply maps 'virtual' file names to physical files for downloading. Currently, I'm getting the view to return a HttpResponseRedirect to a 'files' area, but I don't like this as it means the files are 'publicly' available and I'd like everything to go through