--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/aae2725b-d873-40fd-ae09-d1668ab9e727%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi,
What is a multi-tenant site?
how can i build a multi-tenant django app for django-hotsauce and
asyncio without django-channels?
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFwN1urh-Mb%3D2ZRtwyvZPh9CQoUDHrqN30yQUxhUd5GbUT8XfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
-- Etienne Robillard tka...@yandex.com http://www.isotopesoftware.ca/
Your assumptions all seem correct. Also consider that the security model of WebSockets is... interesting, so securing a multi-tenant setup is going to require a bit more work than you would merely doing the same for HTTP requests.There are other non-Channels options around if you want to look into them, but I suspect they'll all have similar architectural challenges.Andrew
On Fri, Nov 24, 2017 at 3:09 PM, Filbert <tim...@gmail.com> wrote:
Running multi-tenant site using a fork of Django tenant schemas with tens of web servers and thousands of tenants....Piloting a project to implement Channels for real-time notifications, etc.I want to confirm these assumptions:1. Channels really has no support for multi-tenant, I will have to roll my own.2. Since uWSGI is serving us well and (at this point) I wouldn't trust Daphne to serve HTTP, I've got split paths in NGinx for uWSGI and ASGI.3. We are running RabbitMQ, so we have to cluster it and implement channels using asgi_rabbitmq (Redis would just add yet another moving part)4. Plan on significant additional resource requirements on the web server and serious scaling challenges.Are their any other non-Channels options, or is it the really the only game in town?Thanks.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d4906dc8-040b-4ee0-b11d-a7cc918b9e5d%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4d7c94f1-81ad-4949-a987-35f45b188c2f%40googlegroups.com.
class MTSchemaMiddleware: def __init__(self, inner): self.inner = inner
def __call__(self, scope): if "headers" not in scope: raise ValueError( "MTSchemaMiddleware was passed a scope that did not have a headers key " + "(make sure it is only passed HTTP or WebSocket connections)" )
for key, value in scope.get('headers', []): if key == b'host': schema_name = value.decode('ascii').split('.')[0] break else: raise ValueError( "The headers key in the scope is invalid. " + "(make sure it is passed valid HTTP or WebSocket connections)" ) return self.inner( dict(scope, schema_name=schema_name, multitenant=True) )
import MTSchemaMiddleware # from wherever your Middleware class resides
application = ProtocolTypeRouter({ 'websocket': <your stack>(
MTSchemaMiddleware( URLRouter( chat.routing.websocket_urlpatterns )
)
)})
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/daa6bec0-905d-415e-a63f-7d9b6efd8fa4n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN1LePgGs%2BqAucxJvtpY6M%2BAZoWu6rzk9SSHYrdW_sWSJZWAsg%40mail.gmail.com.
|