Re: Getting AttributeError: module 'asyncio' has no attribute '_get_running_loop'

2019-07-07 Thread Andrew Godwin
Hi Rohit, This is my fault - we made a change in the "asgiref" library that inadvertently removed Python 3.5 support. Channels still needs to support it (even though Django doesn't). If you update to asgiref 3.1.4, which I've just released, that should fix the issue. Andrew

Re: Getting AttributeError: module 'asyncio' has no attribute '_get_running_loop'

2019-07-08 Thread Andrew Godwin
The bug was only on Python 3.5. It's possible the other system was 3.6 or 3.7? Andrew On Sun, Jul 7, 2019 at 9:48 AM Rohit Chopra wrote: > Hi Andrew, > > Just a small doubt, why same code is working on my local system. > Both local and server have same version of requirem

Re: Django-channels and JSON-RPC

2017-01-24 Thread Andrew Godwin
guaranteed delivery (at most once) is guaranteed-and-possible-duplicate delivery (at least once), which for RPC systems generally isn't good - in RPC, it's easy to detect if a call didn't work as you won't get a response within a certain timeout. Andrew On Tue, Jan 24, 2017 at 8:

Re: Error connecting websocket with Django Channels

2017-01-24 Thread Andrew Godwin
Hi, I can confirm that the current answer on the page, by tovmeod, is the correct one - you must send back acceptance in connect as of channels 1.0. More here: http://channels.readthedocs.io/en/latest/releases/1.0.0.html#websocket-accept-reject-flow Andrew On Tue, Jan 24, 2017 at 8:48 AM

Re: Django-channels and JSON-RPC

2017-01-24 Thread Andrew Godwin
rver might die, etc.) It's not a normal case, it's just that if something super bad happens, the resulting handling is to drop a message rather than play it twice. Most systems I know of that handle websockets do this. Andrew -- You received this message because you are subscri

Re: Django-channels and JSON-RPC

2017-01-25 Thread Andrew Godwin
Yes, it's a bit alarmist if you don't come from the background of writing distributed systems. I just don't like to hide the truth one bit! All your software and hardware can fail in myriad ways; I have a talk I need to give about it at some point. Knowing how it fails is half the

Re: Django channels on IIS

2017-01-25 Thread Andrew Godwin
Hi, I am afraid I don't have experience using IIS - I don't know if it even supports HTTP/1.1 proxying, which is needed for WebSockets. Hopefully someone else can help. Andrew On Wed, Jan 25, 2017 at 6:35 AM, Алексей Кузуб wrote: > I have a project in Django and i want to use dj

Re: Django-channels and JSON-RPC

2017-01-26 Thread Andrew Godwin
t you turn it from a Django app into a simple Python module though, so you can just do: from channels_jsonrpc import JsonRpcWebsocketConsumer class MyConsumer(JsonRpcWebsocketConsumer): In your own consumers file. Andrew On Thu, Jan 26, 2017 at 12:14 PM, Fabien Millerand wrote:

Re: Django channels deployment

2017-01-26 Thread Andrew Godwin
s a single Redis can handle a LOT of throughput. You also can't use redis-cluster, as it doesn't support some of the operations we use (like BLPOP) Andrew On Thu, Jan 26, 2017 at 1:27 PM, Sgiath wrote: > Hi I am working on some app with Django Channels and I am in the phase > when

Re: Django channels deployment

2017-01-26 Thread Andrew Godwin
nd workers. Andrew On Thu, Jan 26, 2017 at 2:35 PM, Sgiath wrote: > And if I would like to separate some of the infrastructure - for example > dedicate some resources just for one customer. Can I run some workers for > the request based on the, for example, path? > > Example: > I

Re: Django Channels alongside Django Rest Framework

2017-01-31 Thread Andrew Godwin
serve both HTTP and WebSocket requests - Run WebSockets via Daphne, and HTTP to a WSGI server, and use something like nginx in front to split the traffic based on path or header. If you let me know the symptoms of how DRF didn't work via Daphne, I can hopefully help you get things working. Andrew

Re: Channels - query_string

2017-02-01 Thread Andrew Godwin
or even a User object) into the session in the connect consumer, and then let you use it in other consumers that have the same decorator. Andrew On Wed, Feb 1, 2017 at 5:34 AM, Sgiath wrote: > Hi, > I am trying to use the query_string parameter and I want to ask what is > the correct w

Re: Channels - query_string

2017-02-02 Thread Andrew Godwin
f the user into the session and then re-fetch it later on. Andrew On Thu, Feb 2, 2017 at 12:48 AM, Sgiath wrote: > Thanks for explaining. > I have one problem: when I try to save User object to the channel_session > I get exception: TypeError: Object of type 'User' is not JSO

Re: Django-channels can't connect to websocket server. But when I am using redis I can't connect to my site at all.

2017-02-04 Thread Andrew Godwin
If you ever see "Unexpected response code: 200" it means that something between you and the server doesn't understand WebSockets. Given it's localhost in this case, have you installed channels and make sure it's in INSTALLED_APPS, then run `runserver`? Andrew On Sa

Re: Django channels

2017-02-04 Thread Andrew Godwin
"Dispatching message on websocket.receive to channels.routing.null_consumer" means that you don't have a consumer tied to the "websocket.receive" channel, so Channels is sending it nowhere. Did you set up your routing correctly? Andrew On Sat, Feb 4, 2017 at 2:41

Re: Django channels

2017-02-05 Thread Andrew Godwin
hat versions of Channels/Daphne/Django/Python are you using? Andrew On Sun, Feb 5, 2017 at 12:55 PM, Алексей Кузуб wrote: > settings.py > > redis_host = os.environ.get('REDIS_HOST', 'localhost') > > CHANNEL_LAYERS = { > 'default': { >

Re: Django-channels can't connect to websocket server. But when I am using redis I can't connect to my site at all.

2017-02-05 Thread Andrew Godwin
eply_channel_a = reply_channel_name >> pair.reply_channel_b = user_topair.reply_channel_name >> pair.save() >> print(user_topair) >> user_topair.delete() >> >> else: >> # else put the user on the waiting list >>

Re: Django channels

2017-02-06 Thread Andrew Godwin
c files or __pycache__ directories to make sure it's not some old code being cached, and making sure there's not a "routing" directory that clashes with routing.py Andrew On Sun, Feb 5, 2017 at 11:54 PM, Алексей Кузуб wrote: > And workers write me > 2017-02-06 10:42:04,7

Re: Django Channels: best way to launch multiple workers

2017-02-08 Thread Andrew Godwin
, however, recommend running more than 2 - 4 threads per process, as otherwise you'll likely see performance take a slide due to the GIL. Andrew On Wed, Feb 8, 2017 at 11:53 AM, Charlie DeTar wrote: > What's the best way to launch multiple Django channels workers on a > productio

Re: Cannot install channels

2017-02-09 Thread Andrew Godwin
27;s python-dev) it should resolve the error. Andrew On Thu, Feb 9, 2017 at 10:51 PM, Robin Lery wrote: > Hi, > > I already had a django channels in my other virtual env. But since its an > older version of channels (0.7.0) I am trying to install a new channel > version into my p

Re: Cannot install channels

2017-02-09 Thread Andrew Godwin
ot require compilation. Andrew On Thu, Feb 9, 2017 at 11:10 PM, Robin Lery wrote: > Yes that was it. Thank you. Could you please help me understand why this > might have worked before in a earlier different virtual env in the same > vagrant machine? > > On Fri, Feb 10, 2017 a

Re: Django-channels disconnects right after sending a message

2017-02-21 Thread Andrew Godwin
How does it disconnect? What WebSocket close code do you get? (You'll need to add JS to log it) What prints on the Python console? Andrew On Tue, Feb 21, 2017 at 12:27 AM, Nikoleta Misheva wrote: > When I send message the websocket disconnects. I am able to get the > message,

Re: Django-channels disconnects right after sending a message

2017-02-21 Thread Andrew Godwin
I'm afraid I don't really know what's going on then - the logs don't reveal very much. I'd try reducing it down to simpler code until you can replicate it in only a few lines and work from there. Andrew On Tue, Feb 21, 2017 at 11:46 AM, Nikoleta Misheva wrote: >

Re: Django-channels disconnects right after sending a message

2017-02-21 Thread Andrew Godwin
Then you need to add more and more back until it does disconnect and you should be able to find the line that's doing it! Andrew On Tue, Feb 21, 2017 at 11:03 PM, Nikoleta Misheva wrote: > I tried the simplest example and it works fine and does not disconnect. > > def web

Re: Using Django Channels to subscribe to a Redis channel

2017-02-22 Thread Andrew Godwin
ose fields - so, for example, you could route everything with a certain task name to one consumer, and everything else to a catch-all consumer. Andrew On Wed, Feb 22, 2017 at 6:55 AM, Jochen Breuer wrote: > Hi! > > I'm not entirely sure where to start and I hope you can help me. I&#x

Re: django channels in the shell

2017-02-22 Thread Andrew Godwin
I would recommend using the channel layer object directly instead in future: from channels.asgi import get_channel_layer channel_layer = get_channel_layer() That will make sure all settings are applied the same. Andrew On Wed, Feb 22, 2017 at 8:19 PM, chris rose wrote: > solved it.. I had

Re: Daphne does not handle wss requests

2017-02-23 Thread Andrew Godwin
It looks correct - can you connect using https://127.0.0.1:8003/ at that point either? It's really odd that apparently the connection doesn't even happen at all. Andrew On Thu, Feb 23, 2017 at 2:55 AM, Giovanni Colapinto < giovanni.colapi...@gmail.com> wrote: > Hi. > >

Re: Daphne does not handle wss requests

2017-02-24 Thread Andrew Godwin
Hrm, I don't know what's happening then, something in your browser is stopping the connection before it even gets to Daphne. You'd have to break out Wireshark or something and look at what the packets on the wire were (and that's tough with TLS). Anyone else have an idea what&

Re: Sometimes Channels does not work properly

2017-02-26 Thread Andrew Godwin
using runserver) * Getting any JavaScript console logs from the browser as the connections fail * Seeing your basic consumer code, if possible Andrew Andrew On 26 Feb 2017 04:40, "Mohammad Ghasemi" wrote: Hello everyone, I use channels for some real time systems like notifications and chat

Re: Channels - slow with limited number of connections

2017-03-05 Thread Andrew Godwin
What size messages are you sending? Have you tried running workers in separate processes? Andrew On Sun, Mar 5, 2017 at 5:26 AM, Avraham Serour wrote: > I don't think you need 500 workers, the number of workers depends on how > long will message will take to be processed not the numb

Re: Channels - slow with limited number of connections

2017-03-05 Thread Andrew Godwin
uests per second - it's 100 by default. Andrew On Sun, Mar 5, 2017 at 5:17 PM, Lada B wrote: > I just tried to run workers in separate processes and it works great! it's > awesome and it fails only because of redis channel memory being full. Dont > know how to increase it th

Re: Channels vs serverless: how much they are alike

2017-03-06 Thread Andrew Godwin
distributed systems come down to message passing and separate tasks (e.g. SOA infrastructures) that it's hard to talk about these things without a clearer definition of what "serverless" actually means. Andrew On Sun, Mar 5, 2017 at 3:00 PM, Виталик Абеткин wrote: > From wh

Re: Django Channels - Delay server for Group messages

2017-03-07 Thread Andrew Godwin
Not at the moment, the delay server is not built with that in mind. It could be extended to do so if you wanted to look into it. Andrew On Mon, Mar 6, 2017 at 2:09 PM, Adrián Cuesta wrote: > Hi > > Is there any way to send delayed messages to Group instead of a Channel? > > T

Re: Channels + steam(gevent based package)

2017-03-07 Thread Andrew Godwin
Where are you running this steam client from? Presumably not a webserver process, as that doesn't have a main thread. Could you explain a bit more about the architecture and what channel layers you have configured? Andrew On Tue, Mar 7, 2017 at 4:06 AM, Lada B wrote: > I'm us

Re: Channels + steam(gevent based package)

2017-03-07 Thread Andrew Godwin
nal function above. > Then mess I explained above starts to happen. > Even tho steam client is working properly, channels are not and daphne > crashes because of block forever errors and backpressure. > > > > > Dne úterý 7. března 2017 19:08:39 UTC+1 Andrew Godwin napsal(a): >

Re: Channels + steam(gevent based package)

2017-03-07 Thread Andrew Godwin
commands can be good for this) if possible. Andrew On Tue, Mar 7, 2017 at 10:50 AM, Lada B wrote: > Do you have some advice? How should I start it and still be able to send > all needed parameters there and use channels send()? When I start new > Thread it still throws errors and when I st

Re: Will asgi become a PEP like wsgi is ?

2017-03-12 Thread Andrew Godwin
I'll reply to this in the same subject thread on django-developers. Andrew On Sat, Mar 11, 2017 at 2:29 PM, Sebastian Haase wrote: > Hi, > > wsgi is specified by > PEP 333 -- Python Web Server Gateway Interface v1.0 > https://www.python.org/dev/peps/pep-0333/ > > Dj

Re: Django channels being used instead of celery.

2017-03-14 Thread Andrew Godwin
to be, what's retrieving them and how they are stored, I suspect what you want looks more like a slow, reliable task queue than a fast, unreliable one, and if so I would stick with Celery. Andrew On Tue, Mar 14, 2017 at 1:14 PM, Prafull Gaikwad wrote: > Hello everyone, > > I have

Re: Attach consumer to dynamically created single-reader channel (Django Channels)

2017-03-19 Thread Andrew Godwin
ngo; you'd have to do your own ASGI worker class from scratch if you wanted that. Andrew On Sun, Mar 19, 2017 at 5:57 AM, Alexander Prokhorov wrote: > Dear Colleagues, > > I am playing with Channels for some time already. > > Now, I am trying to establish "sticky"

Re: Django channels, more than one project

2017-03-24 Thread Andrew Godwin
Run two Daphne instances, each with a different channel layer configured. To make sure the channel layers for the apps do not conflict, configure them either with different Redis servers or different values for the "prefix" argument to the channel layer on the same server. Andrew On F

Re: Channels - get online users

2017-03-25 Thread Andrew Godwin
er simply, but the performance drops off dramatically as you scale up a system. It will also include connections that are up to a day old (or however long your group_expiry is) Andrew On Sat, Mar 25, 2017 at 9:53 AM, Volodymyr Spodaryk < volodymyr.spoda...@gmail.com> wrote: > Hi, >

Re: Channels - logout not resetting message.user value on new WebSocket connections

2017-03-26 Thread Andrew Godwin
essage.reply_channel on each of a a) correctly denied logged out request, b) correctly accepted logged in request, c) incorrectly accepted logged out request after having just logged out? Andrew On Sun, Mar 26, 2017 at 12:13 AM, Sergio Diaz wrote: > Hello, > > I'm trying out Channels i

Re: Channels - logout not resetting message.user value on new WebSocket connections

2017-03-27 Thread Andrew Godwin
Or make "accept": False do the same as "close": True. The reason that close is a separate argument is that you can pass a WebSocket close code, optionally (we have a default if you don't, but that's probably enough for most people) Andrew On Mon, Mar 27, 2017 at

Re: Channels - logout not resetting message.user value on new WebSocket connections

2017-03-27 Thread Andrew Godwin
To follow up on this - I have updated the spec ( http://channels.readthedocs.io/en/latest/asgi/www.html) to clarify exactly how accept works, added accept: False as an allowed value, and patched Daphne to work with that as of next release. Andrew On Mon, Mar 27, 2017 at 9:52 AM, Andrew Godwin

Re: Would it be a good idea to build a IM app using django channels?

2017-03-31 Thread Andrew Godwin
y as individual messages is not a very cacheable problem (everyone's view is different). Andrew On Fri, Mar 31, 2017 at 4:05 PM, Vic Wei wrote: > I'm trying to build a django Instant Massage app, but I have some > confusions, > My app should the following needs: > 1.be able to

Re: Will function based views ever be deprecated?

2017-04-03 Thread Andrew Pinkham
US 2015, my suggestions seemed polarizing, so make of this what you will. I feel pretty strongly about this topic, and gave a talk about it at the same conference: https://www.youtube.com/watch?v=BJiOERA49ZQ I hope this is helpful! Andrew http://jambonsw.com http://django-unleashed.com -- You

Re: channels/redis exception: TypeError: __init__() got an unexpected keyword argument 'socket_connect_timeout'

2017-04-04 Thread Andrew Godwin
Hi, This is https://github.com/django/asgi_redis/issues/36 - fix is already committed, should be releasing today. Andrew On Mon, Apr 3, 2017 at 3:41 PM, wrote: > Hi all ! > > TypeError is raised when asgi_redis tries to open a connection to redis: > > ``` > Traceback (mos

Re: Django Channels - Class Based Consumers

2017-04-04 Thread Andrew Godwin
, and the stream you're listening to in the JS client is also updatedb_results, so you should set both of these to that value. Andrew On Tue, Apr 4, 2017 at 9:55 AM, Dan Alderman < daniel.thomas.alder...@gmail.com> wrote: > Hi guys, > > Been trying to get my head around this

Re: Django Channels - Class Based Consumers

2017-04-05 Thread Andrew Godwin
The stream is the name of the stream inside the Multiplexer - it's like a sub-channel inside the WebSocket that is used by either end to distinguish packets from each other (it's why you provide it to the JavaScript binding - it needs to know which stream to listen to) Andrew On Wed, A

Re: "'txredisapi' is not defined" after Update to Django 1.11 with Django Channels

2017-04-05 Thread Andrew Godwin
Hi, Can you make sure your asgi_redis installation is upgraded all the way too? And which exact version of Channels do you have installed? Andrew On Wed, Apr 5, 2017 at 4:07 PM, Jochen Breuer wrote: > Hi! > > After Updating Django to version 1.11 with a current Channels installatio

Re: Django channels 1.1.3 not found on pip

2017-04-06 Thread Andrew Godwin
This is now fixed. There was a problem with the release process. Andrew On Fri, Apr 7, 2017 at 4:19 AM, Vaisagh Viswanathan wrote: > I am using django-channels for my project and I needed the specific bug > fix that is part of 1.1.3 version. However, even though the release notes: &

Re: Channels Redis/channelfull spam without any ws connections.

2017-04-07 Thread Andrew Godwin
reproduceable? If so, could you file an issue on the Channels GitHub with versions and steps to reproduce? Andrew On Fri, Apr 7, 2017 at 7:00 AM, wrote: > 1491540549.292837 [0 lua] "LPOP" "asgi:daphne.response.tJbmVMXFGX!" >> 1491540549.343335 [0 unix:/var/r

Re: Automatic reverse migrations

2017-04-14 Thread Andrew Godwin
learn from it! Andrew On Fri, Apr 14, 2017 at 10:33 AM, wrote: > In a modern Continuous Delivery environment, it's expected that there is > an automated process for deploying code, and therefore performing database > migrations. This is all straightforward. > > I haven

Re: Attach consumer to dynamically created single-reader channel (Django Channels)

2017-04-25 Thread Andrew Godwin
You did not miss anything, Daphne does not yet implement that part of the spec. It's something I hope to have in the next release. Andrew On Tue, Apr 25, 2017 at 10:28 AM, Alexander Prokhorov wrote: > Dear Andrew, > > thank you for advice. Now I am starting implementing ASGI w

Can't get error to display when using inlineformset_factory.

2017-04-25 Thread Andrew Michael
I am trying to get validation errors to appear on my web page when using an inlineformset_factory. I have a main form called PersonalInformation form and 3 inline forms (Relative, PositionHeld and Phone). I am receiving the main form errors on my page, but I can't get the 3 inline forms to displ

Re: Multiplex results from (Django-Channels)

2017-04-25 Thread Andrew Godwin
istinguish them. Andrew On Tue, Apr 25, 2017 at 4:25 PM, Yarnball wrote: > Hi, > > I've currently setup Django channels to receive all the `messages` from a > single `room`. However, I would like to set it up to receive `messages` > from several rooms. In DRF, I'd use s

Re: Multiplex results from (Django-Channels)

2017-04-26 Thread Andrew Godwin
or. Either by stuffing multiple names in the URL, or by having commands sent down the socket and handled in the websocket.receive handler to add/remove from groups. There's an example that shows some of this stuff here: https://github.com/andrewgodwin/channels-examples/tree/master/multichat

Re: Can't get error to display when using inlineformset_factory.

2017-04-26 Thread Andrew Michael
ror('state': 'Must select state if province is not entered.') > > > > or > > raise ValidationError({'state': 'Must select state if province is not > entered.'}) > > > > > > *From:* django...@googlegroups.com

Re: Multiplex results from (Django-Channels)

2017-04-26 Thread Andrew Godwin
d a for loop instead. Andrew On Wed, Apr 26, 2017 at 4:49 PM, Yarnball wrote: > Thanks Andrew. I took your advice. I cloned and looking into the example, > and tried what you suggested. > > In my case, the chat is persistent. > > I will not be doing it via URL, instead I'm doi

Re: Channels, Websockets and 'Backpressure'

2017-04-27 Thread Andrew Godwin
of the same docker container - all the workers you run will connect to the same Redis server and be able to drain the channels faster. Andrew On Wed, Apr 26, 2017 at 9:13 PM, Luís Antonio De Marchi < l...@snowmanlabs.com> wrote: > First I need to ask for patience with my English, the t

Re: Django Channels App Design

2017-04-28 Thread Andrew Godwin
; this is a similar type of problem. Certainly, using sessions for this kind of heavy lifting will be expensive to run. Andrew On Fri, Apr 28, 2017 at 10:23 AM, Ethan Knapp wrote: > As background, I am developing a web app that implements Channels in what > seems like an unusual way, so

Having problem with django runserver not working in windows 7

2017-04-29 Thread Andrew James
Hi I'm new to django and I'm having a problem with getting django runserver to work. I'm new to django framework and I'm using windows 7. This is what I've tried so far that I've installed django. I've installed that django in my p drive. and I've tried the path in cmd like p:/python/mysite/man

Re: Django Channels, Nginx, Daphne - Not working?

2017-05-02 Thread Andrew Godwin
Aha, it looks like your daphne instance is only listening on localhost: 2017-05-02 07:01:04,853 INFO Starting server attcp:port=8000:interface=127.0.0.1, channel layer firstproject.asgi:channel_layer. Try binding to all interfaces by passing -b 0.0.0.0 to Daphne when it starts. Andrew On

Re: Django Channels, Nginx, Daphne - Not working?

2017-05-03 Thread Andrew Godwin
machine? Andrew -- 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+unsubscr...@googlegroups.com. To post to this group, send email to dj

Re: [Channels] Recommended quantity of workers

2017-05-03 Thread Andrew Godwin
t appropriately. There is no downside to running multiple workers, though; in fact, it's encouraged. Andrew On Wed, May 3, 2017 at 12:45 PM, Renato Oliveira < renatooliveira@gmail.com> wrote: > Hi > > Is there any recommendation on how many `runworker` processes should we

Re: Daphne and Intermediate certificate

2017-05-04 Thread Andrew Godwin
://twistedmatrix.com/documents/current/core/howto/endpoints.html#servers Andrew On Thu, May 4, 2017 at 7:25 AM, Алексей Кузуб wrote: > Hi! I cam using Django channels and Daphne web server. And I want to use > web sockets with it over https i.e using SSL. Can Daphne use interm

Re: CPU usage by workers

2017-05-08 Thread Andrew Godwin
Daphne does tend to idle hot, but this is so it performs better under high load. It's not clear from your description which of the processes is using more CPU as connections come through and then disconnect - is it Daphne or is it runworker? Andrew On Mon, May 8, 2017 at 5:46 AM, qnub

Re: Channels - using SSL with reverse proxy behind Apache. Does Daphne need to support SSL and WSS?

2017-05-08 Thread Andrew Godwin
- it will forward all traffic to Daphne unencrypted. For URLs, you will have to use "wss://aaa.bbb.ccc:443". If it works with "ws:" only, that means SSL termination is not working and everything is unsecured. Andrew On Mon, May 8, 2017 at 10:37 AM, wrote: > Hi, I'm

Re: Django Channels: Multiple 'send' calls in the same consumer

2017-05-13 Thread Andrew Godwin
/delay.html) or write your own consumer code that talks to channels that uses an asynchronous framework (asyncio, twisted) Andrew On Sat, May 13, 2017 at 11:29 AM, Tristan Barry wrote: > Hi - I'm working with Django Channels (1.1.3) on a Django project and I > have some questions

Re: Channels - unbalanced load for threaded workers

2017-05-17 Thread Andrew Godwin
Hi - I am not sure what you are saying exactly. That the load only goes to some processes? Python threads are strange, the OS may not show stats correctly and I'd generally advise multiple processes instead. Andrew On Wed, May 17, 2017 at 1:53 AM, wrote: > I am trying to deploy Django

Re: Channels - unbalanced load for threaded workers

2017-05-18 Thread Andrew Godwin
at one way uses less CPU but has higher throughput, for example. Andrew On Thu, May 18, 2017 at 12:36 AM, wrote: > Yes, that was my concern that only some processes are loaded. So running > more 'runworker' commands with less '--threads' should give better results? >

Re: Building correct queryset

2017-05-19 Thread Andrew Beales
brand = Brand.objects.get(title='mybrand') products = Product.objects.filter(brand=brand).order_by('-score')[:4] ...gets you the top 4 products in order for the brand On Friday, May 19, 2017 at 10:32:49 AM UTC+1, Горобец Дмитрий wrote: > > Hello. I have these two models. I have to show 4 or less

Re: Send endpoint commands through runserver

2017-05-26 Thread Andrew Godwin
I've already answered the issue you opened on this topic: https://github.com/django/channels/issues/646 Andrew On Fri, May 26, 2017 at 12:37 PM, U.G. Wilson wrote: > Is it possible to send endpoint commands through runserver? > > In daphne I can do this: > > daphne -v2 -

Re: Django Channels and Background Processes

2017-05-30 Thread Andrew Godwin
ystem on top of Django. They will help you do what you want, but you will have to implement your own layer of features and customisation, much like sites on top of Django itself. Andrew On Tue, May 30, 2017 at 5:19 AM, Markus Schaber wrote: > Hi, > > We're currently working on a se

Re: Pyinotify and runserver performance with django channels in docker for mac

2017-06-01 Thread Andrew Godwin
Can I ask what channel layer you are using? That's what affects the speed of messages being transported. Andrew On Thu, Jun 1, 2017 at 1:36 AM, qnub wrote: > Not sure what exactly wrog here, but installing pyinotify not helps to > lower CPU usage in docker on mac OS. As i under

Re: Pyinotify and runserver performance with django channels in docker for mac

2017-06-01 Thread Andrew Godwin
OK, can you try using the Redis one instead and seeing if that's faster? Docker for Mac has a bit of an odd filesystem and kernel and it's possible the IPCLayer is not working well underneath it. Andrew On Thu, Jun 1, 2017 at 10:11 AM, qnub wrote: > Yes, because it's de

Re: django channels group subscriptions

2017-06-01 Thread Andrew Godwin
r the broadcast message bit, and then add state management for processes done in the websocket connect/disconnect methods) Andrew On Thu, Jun 1, 2017 at 7:11 PM, Brian May wrote: > Hello, > > I would like to be able to create a Django Channels group such that: > >1. We

Re: django channels group subscriptions

2017-06-01 Thread Andrew Godwin
ld something on. Andrew On Thu, Jun 1, 2017 at 8:58 PM, Brian May wrote: > On Friday, 2 June 2017 13:04:48 UTC+10, Andrew Godwin wrote: >> >> You can't do what you ask with the current Groups system - it is >> deliberately very simple as anything more complex invol

Re: django channels group subscriptions

2017-06-01 Thread Andrew Godwin
shut it down early) Andrew On Thu, Jun 1, 2017 at 9:26 PM, Brian May wrote: > On Friday, 2 June 2017 14:08:40 UTC+10, Andrew Godwin wrote: >> >> I don't have any direct examples to hand - and this sort of thing does >> come all the time, but much like Django is not in

Re: Channel- Can I dynamically adjust the amount of workers?

2017-06-03 Thread Andrew Godwin
, etc.). It's not something built into Channels as it's a problem better solved by a dedicated tool. Andrew On Sat, Jun 3, 2017 at 2:10 AM, Dennis Kao wrote: > > *I'm trying to use Channel on my chat app & APNs(Apple Push Notification > service), I'm planning to use

Re: django-channels with django-tenant-schemas

2017-06-05 Thread Andrew Godwin
f other reasons. Andrew On Sun, Jun 4, 2017 at 10:16 PM, Suc wrote: > Does django-tenant-schemas affect django-channels message.reply? Im using > ngrok in host header spoofing for multitenancy but im having problem on > sending message on web socket > > > <https://lh3.googleuser

Re: Channels : disconnect alone

2017-06-06 Thread Andrew Godwin
your setup and network rather than Channels. Andrew On Tue, Jun 6, 2017 at 10:59 AM, Okok kokok wrote: > Hello, > > I dont't understand why websocket disconnect alone... > I run with these commands : > >- > >daphne -e ssl::privateKey=:certKey=

Re: Pyinotify and runserver performance with django channels in docker for mac

2017-06-14 Thread Andrew Godwin
10 seconds is still very slow, on my computer it takes around 300 milliseconds (0.3 seconds) for the worst case render. You must have something else installed/configured that is affecting it? Andrew On Wed, Jun 14, 2017 at 12:55 PM, qnub wrote: > Thank you, finally i've checked it a

Re: Django Channels : High CPU usage by workers and 503 responses.

2017-06-15 Thread Andrew Godwin
The error you have looks like https://github.com/django/channels/issues/643, which was fixed in the master branch but not released yet. Could you install channels from the master git branch and see if that improves things? Andrew On Thu, Jun 15, 2017 at 7:19 PM, RAUSHAN RAJ wrote: > Hi, >

Re: Send message to group from server on production by channels.

2017-06-15 Thread Andrew Godwin
What is your CHANNEL_LAYERS configuration? It sounds like the thing running the cron is not on the same layer as everything else. Andrew On Thu, Jun 15, 2017 at 11:27 AM, Петр Гордеев wrote: > Hi, > I have a problem with send message from backend on production. > If I want to send m

Re: [django-channels] Issues with model post_save and Group.Send()

2017-06-19 Thread Andrew Godwin
What's the traceback when the code exits? There has to be some reason it stops there, and whatever your Python code is running in should be able to tell you why (traceback, status code, anything) Without that, I can't help, as it could be anything - your code or Django's. Andrew

Re: [django-channels] Issues with model post_save and Group.Send()

2017-06-20 Thread Andrew Godwin
se line by line. Andrew On Mon, Jun 19, 2017 at 11:59 PM, Mattias Olsson wrote: > There is none - all I can see is that the logging I placed att he very end > of the post_save method logs, but the logger.debug('SupportPingM > utation:post-save') that I placed after the .save() never

Re: Websocket, an existing connection was forcibly closed by the remote host. django-channels

2017-06-27 Thread Andrew Godwin
I would need to see the full console output of the server, and a full package version listing of what you have installed to help you further. On Sun, Jun 25, 2017 at 12:48 PM, Mike Johnson Jr wrote: > So I'm getting the error as described in the title of this post. > > I'm following this tutoria

Re: Django channels for single user

2017-07-05 Thread Andrew Godwin
Yes, you should create a group per user. That way users with more than one tab open will get data sent to all tabs too. Andrew On Wed, Jul 5, 2017 at 6:42 AM, yingi keme wrote: > How will you create a web socket for a single user such that another > program can send a json data to t

Re: Channels: Sudden & Mysterious 400 Bad Request

2017-07-09 Thread Andrew Godwin
I don't really know what's going wrong then, I guess - 400 Bad Request is not something you'd get from misconfiguration usually. Do you get it from Nginx serving a static file too, or just when it proxies through? Andrew On Fri, Jul 7, 2017 at 7:55 PM, wrote: > I'

Re: Django Channels compatibility with Google App/Compute Engine?

2017-07-09 Thread Andrew Godwin
Hi Alex, I don't have any specific advice for GCE - I'm not really sure what their special requirements are. You'll probably have to experiment and see if it's possible with what they supply. Andrew On Sat, Jul 8, 2017 at 1:47 AM, Alex Z wrote: > Hello! I'

Re: Django db backend not FIPS compliant

2017-07-16 Thread Andrew DiPrinzio
I am having the same problem. Anyone have a solution other than patch hashlib? On Wednesday, May 31, 2017 at 9:36:20 AM UTC-4, Tim Graham wrote: > > django-developers discussion: > https://groups.google.com/d/msg/django-developers/dlUIPzQgnpM/Mtl7CQbPAQAJ > > On Tuesday, May 30, 2017 at 5:06:23

Re: Django db backend not FIPS compliant

2017-07-16 Thread Andrew DiPrinzio
All, I have submitted a ticket where i propose the use of the "usedforsecurity=False" flag. Please take a look and comment if you have any thoughts. https://code.djangoproject.com/ticket/28401 On Sunday, July 16, 2017 at 11:22:45 AM UTC-4, Andrew DiPrinzio wrote: > > I am

Re: Django Channels - polling in consumer

2017-07-23 Thread Andrew Godwin
There's a multitude of options you could use for this kind of thing, but I think my recommended approach from the little I know is to write a management command to do it. That way it's easy to launch, and you can still push into the channel layer. Andrew On Sun, Jul 23, 2017 at 9:52 A

Re: [Django Channels] Can I use the same redis server as message backend and cache backend the same time?

2017-08-05 Thread Andrew Godwin
usage and it's good practice to run them separately. Andrew On Sat, Aug 5, 2017 at 9:35 PM, CrazyNPC wrote: > I have 2 questions. > 1.Can I use the same redis server as message backend and cache backend the > same time? > 2.Can I use the same redis server as message backend f

Re: Django Channels and multiple servers

2017-08-06 Thread Andrew Godwin
You probably got into a moderation queue. I'll reply to the other post. Andrew On Mon, Aug 7, 2017 at 4:49 AM, Cristiano Coelho wrote: > For some reason my original question got lost. > > http://channels.readthedocs.io/en/stable/deploying.html > > I don't quite unde

Re: About channels and scaling up

2017-08-06 Thread Andrew Godwin
Yes, this is a problem, and as it says it would only work for some site designs (where you're OK with sharding the live userbase). We're fixing this architectural issue in the next major Channels release, but it's going to take a little time. Andrew On Mon, Aug 7, 2017 at 4:2

Re: Django Channels - Throttling/Traffic Management?

2017-08-08 Thread Andrew Godwin
e too precise advice just yet) Andrew On Tue, Aug 8, 2017 at 10:19 AM, Jamie Counsell wrote: > Hey folks, > > I'm working on a Django Channels project and was wondering if there was > (or was a roadmap for) features that could help us control load issues at > the applica

Re: Django Channels - Throttling/Traffic Management?

2017-08-10 Thread Andrew Godwin
source of info right now is my blog post at https://www.aeracode.org/2017/7/11/towards-channels-20/ - more docs will come as we finalise the design, but that will take a bit longer. Andrew On Tue, Aug 8, 2017 at 1:43 PM, Jamie Counsell wrote: > Hey Andrew, > > Thanks for the prompt re

Re: Channels: Add channel from one group to another

2017-08-20 Thread Andrew Godwin
There's no fast-performing way to do this - we'll be able to make it easier in the upcoming Channels 2.0, but for now the best you could get is going through the list of channels in the group and that's very slow. Andrew On Sat, Aug 19, 2017 at 11:33 PM, Никита Екатеринчук wrot

<    3   4   5   6   7   8   9   10   >