Re: actual django stack

2008-09-25 Thread Marcelo Sanches

I use both, apache mod_python to server django code and nginx at port 80 to 
serve just media and static files.

- Original Message - 
From: "Frédéric Sidler" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, September 25, 2008 4:41 PM
Subject: actual django stack


>
> What it the best Django stack today.
>
> In django doc, it says that apache with mod_python is the best
> solution in production. But in the same time I see that everyblock use
> nginx (probably in mode fastcgi).
>
> Did you some of you test different solution and can share some output 
> here.
>
> Here are the ones I see actually
>
> Apache mod_python
> Apache in fastcgi mode
> Lighttpd in fastcgi mode
> Nginx in fastcgi mode
>
> I'm not talking about load balancer, memcached and database here, just
> the application.
>
> >
>
> -- 
> Esta mensagem foi verificada pelo sistema de antivírus e
> acredita-se estar livre de perigo.
> 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django... False promises?

2008-01-04 Thread Marcelo Sanches

> Are you sure? I think that the online docs are actually correct here...

Yes, i am sure.

If you try to set CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True, you will notice
that the version on django book is the correct one.

From Django Documentation:

Put the CacheMiddleware before any other middleware that might add something
to the Vary header (response middleware is applied in reverse order). The
following middleware modules do so:

-SessionMiddleware adds Cookie
-GZipMiddleware adds Accept-Encoding
-LocaleMiddleware adds Accept-Language

More from the docs ...

Note that if you use CACHE_MIDDLEWARE_ANONYMOUS_ONLY, you should make sure
you've activated AuthenticationMiddleware and that AuthenticationMiddleware
appears before CacheMiddleware in your MIDDLEWARE_CLASSES.

So following the Django Documentation it is NOT possible to set the order as
required, AuthenticationMiddleware before CacheMiddleware and
CacheMiddleware before SessionMiddleware, since SessionMiddleware is needed
before AuthenticationMiddleware.

AuthenticationMiddleware
CacheMiddleware
SessionMiddleware

Following Django Book this is possible:
(Put the CacheMiddleware ***after*** any middlewares that might add
something to the Vary header. (SESSION MIDDLEWARE is one of then)

SessionMiddleware
AuthenticationMiddleware
CacheMiddleware

Tested with memcache and working this way.

Regards,

Marcelo




- Original Message - 
From: "SmileyChris" <[EMAIL PROTECTED]>
To: "Django users" <django-users@googlegroups.com>
Sent: Friday, January 04, 2008 6:15 PM
Subject: Re: Django... False promises?


>
> On Jan 5, 4:09 am, "Marcelo Sanches" <[EMAIL PROTECTED]> wrote:
> > I agree ! After trying to configure the django cache system  I notice
that
> > the online docs are wrong and the django book have the correct
information
> > about the order of  MIDDLEWARE_CLASSES.
> >
> > ONLINE DOCS YOU WILL FIND:
> > ...
> >
> > DJANGO BOOK YOU WILL FIND THE CORRECT INFORMATION
> > ...
>
> Are you sure? I think that the online docs are actually correct here...
> >
>
> -- 
> Esta mensagem foi verificada pelo sistema de antivírus e
>  acredita-se estar livre de perigo.
>


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django... False promises?

2008-01-04 Thread Marcelo Sanches

> While I understand Ken's point about the book, in that it is no longer
> the complete reference, I would *not* recommend just forgetting it.
> Instead, use it as the valuable resource it is, and supplement your
> nautical sojourn with reference to the online documentation as needed.
>  I, for one, have found the book to be extremely helpful overall, as
> well as useful in helping to clarify parts of the online documentation
> that are, perhaps, overly terse.


I agree ! After trying to configure the django cache system  I notice that
the online docs are wrong and the django book have the correct information
about the order of  MIDDLEWARE_CLASSES.

ONLINE DOCS YOU WILL FIND:

If you use CacheMiddleware, it's important to put it in the right place
within the MIDDLEWARE_CLASSES setting, because the cache middleware needs to
know which headers by which to vary the cache storage. Middleware always
adds something to the Vary response header when it can.

Put the CacheMiddleware  *before*  any other middleware that might add
something to the Vary header (response middleware is applied in reverse
order).

DJANGO BOOK YOU WILL FIND THE CORRECT INFORMATION

If you use CacheMiddleware, it's important to put it in the right place
within the MIDDLEWARE_CLASSES setting, because the cache middleware needs to
know the headers by which to vary the cache storage.

Put the CacheMiddleware ***after*** any middlewares that might add something
to the Vary header.

As you can see the djangobooks can help sometimes ;-)

Regards,

Marcelo Sanches




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---