Le 31 janv. 2011 à 07:30, James Hancock a écrit :

> This post is getting pretty long. But I had a simple Django fix that would 
> make it work a lot easier for me, and might help others. (I say this because 
> of how I implemented it, I am working with about 60 different sites and it is 
> a pretty simple arrangement)
> 
> Imagine you were able to set a site_id per request rather than relying on the 
> settings SITE_ID. Django would then checked for a request's site_id first and 
> then second check the settings one.
> 
> It is really simple, but it would fix a lot of my problems and avoid having 
> to switch around the settings SITE_ID per request. Setting the requests 
> site_id with middleware is straightforward enough and further customizations 
> to the request. Changing the urls for example.
> 
> This approach would avoid:
> Threading issus, and global variables
> Adding new functions to work with (Saves time and pain, documentation, 
> testing, releases so forth)
> Doesn't break things that are tied into the Sites Framework(site-maps, 
> comments, etc...)
> It also feels a little more DRY to me.
> 
> Let me know if I have assumed something I shouldn't have. I don't know much 
> about how the current implementation and use of SITE_ID in the backend.
> 
> Cheers,
> James Hancock

The thread is pretty long because there are also 2 threads in one:
 - one for simply changing the site_id per request
 - one for changing the all setting per request

This being said, your solution sound pretty simple  but would probably require 
all the applications to be rewritten.
If your own applications aren't much an issue, other might be.

Regards,
Xavier.

-- 
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 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to