Re: Better Support for static file serving via django

2007-12-14 Thread Kevin Menard


On Dec 12, 2007, at 3:19 PM, Robert Coup wrote:

>
> On 13/12/2007, Thomas Güttler <[EMAIL PROTECTED]> wrote:
>> How can you check that only authorized users can access
>> some files?
>>
>> Files which have a coresponding FileField in the model: How can
>> you test that only some people are allowed to see it?
>>
>> Apache can't do it. Or at least it would be complicated.
>
> It's not /that/ complicated...
> http://www.djangoproject.com/documentation/apache_auth/
>

Apache auth is not all that difficult, no.  Setting up access control  
using Location blocks and authenticating against the Django user  
database is a bit of an undertaking, however.

It'd be nice to see the ticket Chris posted get accepted into trunk.   
It's still not quite as simple as Robert was initially looking for,  
but it's a big step in the right direction.

-- 
Kevin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~--~~~~--~~--~--~---



Re: Better Support for static file serving via django

2007-12-13 Thread Thomas Guettler

Am Mittwoch, 12. Dezember 2007 21:34 schrieb SmileyChris:
> On Dec 13, 9:19 am, "Robert Coup" <[EMAIL PROTECTED]>
>
> wrote:
> > On 13/12/2007, Thomas Güttler <[EMAIL PROTECTED]> wrote:
> > > How can you check that only authorized users can access
> > > some files?
>
> Thomas, you might want to try out http://code.djangoproject.com/ticket/3583
> It needs some testing/feedback before I'll promote it to ready for
> checkin. You seem like a perfect candidate ;)

I will use mod_wsgi in the future. But according to a release note,
it supports authentication and authorization, too.

 Thomas

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~--~~~~--~~--~--~---



Re: Better Support for static file serving via django

2007-12-12 Thread msaelices



On 12 dic, 01:30, "Mike Scott" <[EMAIL PROTECTED]> wrote:
> Hey All,
>
> I've been looking at how to better serve my static files for django sites,
> and I'm particularly interested in things like Javascript handling.
>
> For example if we were to look at RoR, they have their include tags which
> can automatically compile javascript into one big file, compressing and
> obfusicating it.

Maybe this snippets helps you ;-)

http://www.djangosnippets.org/snippets/405/

>
> Is this an approach the bulk of the Django community are interested in
> taking or is it something that we should leave to the things that do it
> best, ie: Apache and the like.
>
> Regards,
>
> Mike Scott
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~--~~~~--~~--~--~---



Re: Better Support for static file serving via django

2007-12-12 Thread SmileyChris


On Dec 13, 9:19 am, "Robert Coup" <[EMAIL PROTECTED]>
wrote:
> On 13/12/2007, Thomas Güttler <[EMAIL PROTECTED]> wrote:
>
> > How can you check that only authorized users can access
> > some files?

Thomas, you might want to try out http://code.djangoproject.com/ticket/3583
It needs some testing/feedback before I'll promote it to ready for
checkin. You seem like a perfect candidate ;)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~--~~~~--~~--~--~---



Re: Better Support for static file serving via django

2007-12-12 Thread Robert Coup

On 13/12/2007, Thomas Güttler <[EMAIL PROTECTED]> wrote:
> How can you check that only authorized users can access
> some files?
>
> Files which have a coresponding FileField in the model: How can
> you test that only some people are allowed to see it?
>
> Apache can't do it. Or at least it would be complicated.

It's not /that/ complicated...
http://www.djangoproject.com/documentation/apache_auth/

Rob :)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~--~~~~--~~--~--~---



Re: Better Support for static file serving via django

2007-12-12 Thread Thomas Güttler

Am Mittwoch, 12. Dezember 2007 01:48 schrieb [EMAIL PROTECTED]:
> It sounds like you're actually proposing two things here.
>
> 1) Using Django to serve static files.  There already exists a
> mechanism for Django to accomplish this during development, detailed
> here: http://www.djangoproject.com/documentation/static_files/ ,
> although it's not a good idea to use this in production.

How can you check that only authorized users can access
some files?

Files which have a coresponding FileField in the model: How can
you test that only some people are allowed to see it?

Apache can't do it. Or at least it would be complicated.

 Thomas

-- 
Thomas Güttler, http://www.tbz-pariv.de/ 
Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917
TBZ-PARIV GmbH  Geschäftsführer: Dr. Reiner Wohlgemuth
Sitz der Gesellschaft: Chemnitz Registergericht: Chemnitz HRB 8543

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~--~~~~--~~--~--~---



Re: Better Support for static file serving via django

2007-12-11 Thread Robert Coup

On 12/12/2007, Mike Scott <[EMAIL PROTECTED]> wrote:
> I've been looking at how to better serve my static files for django sites, 
> and I'm particularly interested in things like Javascript handling.
>
> For example if we were to look at RoR, they have their include tags which can 
> automatically compile javascript into one big file, compressing and 
> obfusicating it.

There are a number of good tools to do javascript "compilation" -
check out Dojo's compressor[1] and the way it the dojo packaging
system uses layers which can be combined for different pages[2]. In
our projects we've written tags to help with loading javascript into
specific pages.

Rob :)

[1] http://dojotoolkit.org/docs/shrinksafe
[2] 
http://dojotoolkit.org/book/dojo-book-0-9/part-4-meta-dojo/package-system-and-custom-builds

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~--~~~~--~~--~--~---



Re: Better Support for static file serving via django

2007-12-11 Thread [EMAIL PROTECTED]

It sounds like you're actually proposing two things here.

1) Using Django to serve static files.  There already exists a
mechanism for Django to accomplish this during development, detailed
here: http://www.djangoproject.com/documentation/static_files/ ,
although it's not a good idea to use this in production.

2) Using Django to compile, compress, and obfuscate javascript into
one file.  This sounds like something that's a bit more reasonable,
although some might argue that you could write a utility to do this up-
front, and let the server serve it statically.  Someone has done
something very similar to your proposal, but with images, and you can
check that out here: http://www.djangosnippets.org/tags/imagebundle/
.  The way that amitu went about promoting his/her imagebundle was a
really good approach: write some code, paste it to djangosnippets.org,
and see if others find it useful.  If you're looking to implement your
Javascript obfuscation and merging filter, you might want to go a
similar route.

Hopefully that helps.

-Eric Florenzano

On Dec 11, 6:30 pm, "Mike Scott" <[EMAIL PROTECTED]> wrote:
> Hey All,
>
> I've been looking at how to better serve my static files for django sites,
> and I'm particularly interested in things like Javascript handling.
>
> For example if we were to look at RoR, they have their include tags which
> can automatically compile javascript into one big file, compressing and
> obfusicating it.
>
> Is this an approach the bulk of the Django community are interested in
> taking or is it something that we should leave to the things that do it
> best, ie: Apache and the like.
>
> Regards,
>
> Mike Scott
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~--~~~~--~~--~--~---



Re: Better Support for static file serving via django

2007-12-11 Thread Collin Grady

Mike Scott said the following:
> Is this an approach the bulk of the Django community are interested in
> taking or is it something that we should leave to the things that do it
> best, ie: Apache and the like.

-1 to handling media through Django, that's the job of the webserver :)

-- 
Collin Grady

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~--~~~~--~~--~--~---