On Wed, 2008-02-13 at 14:52 +0100, Johan Liseborn wrote:
[...]
> As far as I can tell, the Django site-system relies on the different
> sites having different domains,

Well not exactly, but close. The idea is one site per settings file. At
the moment you can't change that to be more dynamic. It's a long-term
plan to be able to do so, but it's very low priority and not entirely
trivial (it's part of a larger set of things to be more
WSGI-accommodating).

>  while my requirement seems to indicate
> that the "site" (or pseudo-domain) should be decided by the logged in
> user rather than the domain name, so I am a bit pessimistic that I can
> accomplish what I say above, even though the two use cases seems very
> similar data-handling-wise; please tell me I am wrong... :-)

Well, they're similar in that different access paths see different data,
but that's pretty much everything in web land. The Sites framework is
one level at which these access paths can be controlled. You want to
control it at a different level: per-request.

If I was going to be doing this, I'd almost certainly just write up a
quick middleware that ran after the authentication middleware on the
request path and set an attribute on the request object indicating the
"site" (in your model) to use for further lookups. Then it's just a
matter of filtering lookups with that restriction each time. Needs a
little thought, depending on what you're doing, but certainly possible.

> Also, is there a way to play with the sites-system using runserver? It
> seems you need to have multiple settings-files (which I guess would be
> simple using e.g. Apache and a bunch of virtual hosts), but it seems I
> cannot do that with runserver.

There's nothing to stop you creating multiple settings files and
starting multiple runserver instances on different ports.

Regards,
Malcolm

-- 
If at first you don't succeed, destroy all evidence that you tried. 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to