Hi,

There's a couple of ways to do this, but none of them is really as
easy as using basic/digest authentication in apache.

Most of the methods posted until now passes the static file through
django or at least python, which might not be ideal depending on your
performance requirements.

Anyway, here are two more methods:

1) Use lighttpd with mod_secdownload (http://redmine.lighttpd.net/
projects/lighttpd/wiki/Docs:ModSecDownload). On the page there's an
example how to do it with django. Basically you just generate a token,
that only you django app and lighttpd server can generate. Bad thing
with this method, is that you don't have constant URLs.

2) Use Apache + mod_auth_tkt. mod_auth_tkt is a lightweight module,
that works nearly the same way as mod_secdownload. It just puts the
token in a cookie and can associate some strings with it (like user/
group etc). Then in apache, you just use a htaccess file to protect
your resources.

Other more complicated things you can look at is single sign-on
solutions for your webserver and django, but it usually starts to get
really complicated.

Cheers,
Lars

On Sep 11, 11:03 pm, Jim Myers <myer...@gmail.com> wrote:
> I have a requirement to serve static files only to users authenticated
> through Django secure login.
> That means I can't use apache basic/digest authentication for those
> files.
>
> So far in my searches of the web and Django docs, I've found no way to
> do this.
> Of course my alternative is to serve ALL the static files through
> Django but that's not very palatable.
>
> Have I missed anything? What is needed to make this work?
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to