Re: One Django instance, hundreds of websites

2011-01-27 Thread Jjdelc
If all you need to change is the SITE_ID on the settings file, using different files for each is not only a mess to handle, but also means that you'll spend extra RAM for each instance running. I solve this by using a middleware that changes the SITE_ID based on the request's hostname: SITES_DICT

PSF Sponsored Sprints Initiative

2011-01-27 Thread Alex Gaynor
Hello Django Developers, On behalf of the Python Software Foundation’s sponsored sprint group, I wanted to drop your group a quick note introducing us. If you’re already familiar with our sponsored sprints, you’ll be happy to know we made a few changes to help both sprint groups and Python even mo

Re: One Django instance, hundreds of websites

2011-01-27 Thread Graham Dumpleton
On Friday, January 28, 2011 2:09:06 AM UTC+11, Tom Evans wrote: > > On Wed, Jan 26, 2011 at 6:18 PM, Jari Pennanen > wrote: > > On Jan 26, 6:56 pm, FeatherDark wrote: > >> Greetings huge django developer list, > >> I just wanted to mention, this method totally works for me, I call it > >> "Ski

Re: One Django instance, hundreds of websites

2011-01-27 Thread Jari Pennanen
Scrub my above message, here is the new revised and working summary for per site login: 1. user_logged_in signal callback that adds request.session[SITE_ID_SESSION_KEY] = request.site_id 2. AuthenticationForm with clean that does authenticate(site_id, username, password) 3. MultiSitedAuthenticatio

Re: One Django instance, hundreds of websites

2011-01-27 Thread Jari Pennanen
I think I've found the necessary tools making the Django login to work per site basis: 1. Create own login view that calls the auth backend with authenticate(site_id, username, password) 2. Create own auth backend that takes site_id, username and password (also checks permissions by site) 3. *)

Re: One Django instance, hundreds of websites

2011-01-27 Thread Tom Evans
On Wed, Jan 26, 2011 at 6:18 PM, Jari Pennanen wrote: > On Jan 26, 6:56 pm, FeatherDark wrote: >> Greetings huge django developer list, >> I just wanted to mention, this method totally works for me, I call it >> "Skinning" >> >> In the templates folder I have a file called "base.html' >> Inside t

Re: annotating fields with null=True

2011-01-27 Thread Sergiy Kuzmenko
The same problem occurs with PostreSQL as well: nulls (if present) are always returned with zero count in aggregates. Since my post did not stir much of a commotion I conclude that there are no strong opinions among django developers as to which form of count should be used in aggregates. So I'll