Re: admin ViewDoesNotExistError

2014-06-29 Thread Andrew Choi
Martin, Perhaps try copying over the folder configuration from the non-error-triggering project and try to continue from there. Also, perhaps permissions are to blame? Andrew On Sunday, June 29, 2014 2:22:11 AM UTC+9, Martin Spasov wrote: > > Hello guys, I am following the Tango with

Multiple projects on one server

2014-07-02 Thread Andrew Pashkin
this is looks ugly. -- With kind regards, Andrew Pashkin. cell phone - +7 (985) 898 57 59 Skype - waves_in_fluids e-mail - andrew.pash...@gmx.co.uk -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Multiple projects on one server

2014-07-02 Thread Andrew Pashkin
Sorry, I wrote to wrong mailing list (facepalm.jpg). But actually the topic is relevant to django-users too =) On 02.07.2014 12:11, Andrew Pashkin wrote: Hi all! Does anybody had experience in managing deployment of two or moredifferent projects on one system? I have such task and main issue

Re: Returning submitted formset data to the template for further editing

2014-07-02 Thread Andrew Choi
t and AJAX calls. This would only be feasible if the information that you're using to process does not need to be secret. Then again, writing a client-side data processor might be just as much work as writing formset validation code from scratch. Andrew On 07/02/2014 03:58 PM, Daniele Pro

Re: Receive Websocket Message from extern task

2017-10-23 Thread Andrew Godwin
I'm not sure what you mean by "receive websockets from an external Python task" - if you want to connect out to your server using a WebSocket from Python, there are libraries that do that. Andrew On Mon, Oct 23, 2017 at 7:40 AM, 'matrix1900' via Django users < d

Re: How to start and stopp threads in Django/Channels while using websockets

2017-10-27 Thread Andrew Godwin
You can't do this from inside Django right now - the background workers were designed to solve this problem. Andrew On Fri, Oct 27, 2017 at 6:26 AM, 'matrix1900' via Django users < django-users@googlegroups.com> wrote: > Hi , > > > in my project, I want t

Re: Would it be feasible or an overkill to use channels for real time notification in a Django application.

2017-11-19 Thread Andrew Godwin
s as more people use it), then add in either long-polling, WebSockets or both as options based on what gives you the best return in terms of UX and development time. Andrew On Sun, Nov 19, 2017 at 4:41 AM, Rajesh Yogeshwar < rajesh.yogesh...@gmail.com> wrote: > I have a SAAS application

Re: How to use channels and make a site highly available?

2017-11-21 Thread Andrew Godwin
absolutely need that. Andrew On Tue, Nov 21, 2017 at 9:05 AM, Sergey Pashinin wrote: > Channels recommends using Redis. > I thought I will setup Redis Cluster (https://redis.io/topics/ > cluster-tutorial) behind HAProxy and it will be all fine. > But Channels does not support

Re: Django Channels and multi-tenant will this be a world of hurt?

2017-11-24 Thread Andrew Godwin
into them, but I suspect they'll all have similar architectural challenges. Andrew On Fri, Nov 24, 2017 at 3:09 PM, Filbert 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 i

Re: Django Channels and multi-tenant will this be a world of hurt?

2017-11-26 Thread Andrew Godwin
I've never used attach-daemon so I can't help you there I'm afraid. As long as it does sensible process-management things it's probably alright? Andrew On Sat, Nov 25, 2017 at 5:17 PM, Filbert wrote: > Andrew, > Thanks for the response. Seeing that I am keeping uWS

Re: Django Channels and multi-tenant will this be a world of hurt?

2017-11-27 Thread Andrew Godwin
That would be correct (though please be aware Origin can be faked like host headers, so don't use it as the sole point of security). Is it not available via the headers list in the connect message? Andrew On Mon, Nov 27, 2017 at 2:58 PM, Filbert wrote: > Thanks again. One last ques

Re: Getting channels 2 to work

2017-12-01 Thread Andrew Godwin
prepping Channels 2 for a beta release, which will include routing and setup examples. Andrew On Fri, Dec 1, 2017 at 6:03 AM, John Wayne wrote: > Hi everyone, > > I am stuck getting the new channels 2 to a working state. I installed > django==2.0rc1, and channels==2.0.x, daphne=

Re: Getting channels 2 to work

2017-12-04 Thread Andrew Godwin
Hi John, The ProtocolTypeRouter currently does this for you automatically as long as you don't specify a `http` handler. Otherwise, the ASGI application that runs Django's view system is channels.http.AsgiHandler Andrew On Mon, Dec 4, 2017 at 7:56 AM, John Wayne wrote: > Hi Andr

Re: Django Channel Error

2017-12-07 Thread Andrew Godwin
That error means you are not actually running a websocket-capable server. Did you add "channels" to INSTALLED_APPS? Andrew On Thu, Dec 7, 2017 at 12:03 AM, Maitreya Verma wrote: > I am following this tutorial > <https://gearheart.io/blog/creating-a-chat-with-django-channels/

Re: Channels: starting Daphne in production

2017-12-12 Thread Andrew Godwin
Hm, that looks to be like logging from asgi_rabbitmq - could you post your settings configuration? And have you tried running with a different channel layer? Andrew On Tue, Dec 12, 2017 at 10:14 AM, Filbert wrote: > Trying to come up with the proper command line to start Daphne in > prod

Re: Django Channels: Model Binding not sending out message to group

2017-12-13 Thread Andrew Godwin
Since you double-posted, I will reply to the other thread. On Wed, Dec 13, 2017 at 12:00 AM, Zac Kwan wrote: > I have nginx, uwsgi and asgi setup correctly. With my javascript frontend, > it is connected to base on the worker log that contains the demultiplexer > response. However, when I try to

Re: Django Channels Model Binding not sending messages

2017-12-13 Thread Andrew Godwin
That is odd behaviour - have you tried to see if it's actually the group send, or something like trying to send it twice? Can you post your binding configuration? Andrew On Wed, Dec 13, 2017 at 4:14 AM, Zac Kwan wrote: > In production, I have setup asgi, wsgi and nginx. My javascript

After update, auth migration fails.

2017-12-15 Thread Andrew Buchan
longs to Django's auth app. Now surely I'm not the only person using MySQL who's come across this? Any ideas? Thanks, Andrew. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and st

Re: After update, auth migration fails.

2017-12-18 Thread Andrew Buchan
hanks, Andrew On Friday, December 15, 2017 at 9:12:04 PM UTC, Andrew Buchan wrote: > > Hi everyone, > > Vital stats: MySQL, python 3.5, Ubuntu, not using South. > > I'm upgrading from 1.9.5 to 1.11.8, and in amongst that there is a > migration to change to username

Re: After update, auth migration fails.

2017-12-18 Thread Andrew Buchan
nhold wrote: > > Andrew, > Not real sure on the fix, but the error seems more to be data related. > Is it just saying it's trying to add a record that exits? > For the MySQL issue, the foreign key is on the 'id' field in user, which > is not changing size, just the us

Re: Channels routing - must parse path to separate between consumers?

2017-12-19 Thread Andrew Godwin
What you describe there seems like a bug - the first include() should be adding path restrictions. What's confusing is that you said _both_ consumers are getting called? As in each event goes to two routing entries? That definitely shouldn't happen. Andrew On Tue, Dec 19, 2017 at 4

Re: After update, auth migration fails.

2017-12-20 Thread Andrew Buchan
roc: https://forums.mysql.com/read.php?20,137634 So this glitch doesn't/won't happen in the live database. Anyway, back to resolving the myriad other things that are breaking due to the migration, yay! Thanks for chipping in Dylan, it did actually help. Andrew -- You received this mes

Re: Channels routing - must parse path to separate between consumers?

2017-12-20 Thread Andrew Godwin
If you can replicate consumers being called twice on one event that's a serious issue we need to look into (the only thing that does this by design is the multiplexer, which calls all its sub-consumers for all events). Andrew On Wed, Dec 20, 2017 at 4:50 AM, SK wrote: > Yes. That

How do I know what version a patch is included in?

2017-12-20 Thread Andrew Buchan
I'm being affected by this bug: https://code.djangoproject.com/ticket/28562 which was fixed 4 months ago. Somewhere on the ticket page it says: Version: 1.11 → master Which is the only reference to version I found anywhere on the page, so I assumed this meant the fix was in 1.11 I've just sp

Re: How do I know what version a patch is included in?

2017-12-21 Thread Andrew Buchan
oking that ticket it was fixed in master branch and then backported > to 2.0.x branch. > > In this case it's not very obvious that issue is fixed in 2.0+ > > > 20.12.2017 8.33 ip. "Andrew Buchan" kirjoitti: > > I'm being affected by this bug: https://code.d

Re: How do I know what version a patch is included in?

2017-12-21 Thread Andrew Buchan
Thanks, I think I understand... On Wednesday, December 20, 2017 at 6:32:52 PM UTC, Andrew Buchan wrote: > > I'm being affected by this bug: > https://code.djangoproject.com/ticket/28562 which was fixed 4 months ago. > > Somewhere on the ticket page it says: > > Version

Response is None in exception handling?

2017-12-21 Thread Andrew Buchan
I'm upgrading from Django 1.11 to Django 2.0 and getting the following error trying to load any page: Internal Server Error: /favicon.ico Traceback (most recent call last): File "/home/andrew/projects/healthmatters/website/env/lib/python3.5/site-packages/django/core/handlers/ex

Re: Response is None in exception handling?

2017-12-21 Thread Andrew Buchan
= get_response def __call__(self, request): response = self.get_response(request) if not request.user.is_anonymous and not request.user.profile.has_read_tcs: return redirect('read_and_sign_tc') return response Thanks for your help! Andrew On

Re: Asynchoronous programming and websockets support

2018-01-11 Thread Andrew Godwin
a long way towards making it so) Andrew On Fri, Jan 12, 2018 at 3:55 AM, Mike Dewhirst wrote: > On 12/01/2018 11:05 AM, muratsert1...@gmail.com wrote: > >> Hello Django community, >> >> This is my first post so forgive me if this is out of context or have >> been discuss

Re: Asynchoronous programming and websockets support

2018-01-12 Thread Andrew Godwin
e's also a severe lack of people willing to sit down and work on this stuff as it's super hard and I'm currently a bit burnt out on my capacity to train up new people on it, though I'd like to get back to that point by the end of the year. Andrew On Fri, Jan 12, 2018 at 12:

Re: [django-channels] post-process message from Group

2018-01-17 Thread Andrew Godwin
production, but is close, and if you want to start playing around with it now you can: http://channels.readthedocs.io/en/2.0/ Andrew On Wed, Jan 17, 2018 at 5:42 AM, Tomáš Ehrlich wrote: > Hello everyone, > I’m trying to connect django-channels with GraphQL subscriptions (using > gra

Re: How do I set the value of a model object's property after using `get_field()`?

2018-01-22 Thread Andrew Standley
_name to set that attribute on the instance `setattr(model_obj, column_name) = 100` and finally save those changes `model_obj.save()` See https://docs.djangoproject.com/en/1.11/topics/db/queries/# -Andrew On 1/21/2018 9:44 PM, Tom Tanner wrote: I'm making a

Re: Django-Channels: Answer from Background task to channel (websocket)

2018-01-28 Thread Andrew Godwin
redis server to see if messages actually get sent to it? (You'll see an RPUSH command for that). Andrew On 28 Jan 2018 08:14, "Arne Wieding" wrote: > Hi there, > > i have implemented django channels into my project to turn an intensive > data importing task into a backg

Re: Django-Channels: Debugging

2018-01-29 Thread Andrew Godwin
I'm not sure why the print messages were buffered - next time try flushing stdout and see if that makes it work. Andrew On Mon, Jan 29, 2018 at 6:49 AM, 'Matthias Brück' via Django users < django-users@googlegroups.com> wrote: > Ok, i found the problem, the authent

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
Hi Ahmed, In the new release channel layers are optional - if you don't configure them they will indeed come through as None. The settings format changed slightly too - you can read more here: http://channels.readthedocs.io/en/latest/topics/channel_layers.html Andrew On Fri, Feb 2, 2018 at

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
Do you have a CHANNEL_LAYERS setting in your settings file? If so, what is it set to? Andrew On Fri, Feb 2, 2018 at 5:17 PM, Ahmed Magdy wrote: > That's what I did after reading the documentation here's how my channels > files look like > > # settings.py >

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
It needs to contain a value to work - what value were you trying that was not empty? Andrew On Fri, Feb 2, 2018 at 8:04 PM, Ahmed Magdy wrote: > I tried not having CHANNEL_LAYERS or setting it to {} > same exception > > On Saturday, February 3, 2018 at 3:36:43 AM UTC+2, Andrew

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
No, there is no in-memory channel layer any more, only Redis is available at the moment. You must put something into the settings in order to make it function. Andrew On Fri, Feb 2, 2018 at 8:42 PM, Ahmed Magdy wrote: > I thought it uses in memory channel layer by default if it's

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
The docs do mention this in a big callout at the top of the Channel Layers page :) http://channels.readthedocs.io/en/latest/topics/channel_layers.html Andrew On Fri, Feb 2, 2018 at 8:52 PM, Ahmed Magdy wrote: > Aha thanks for making it clear, I will read more about redis then. > Shouldn

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
Yup, that looks like a genuine bug, I have opened a GitHub issue to track it: https://github.com/django/channels/issues/848 Andrew On Fri, Feb 2, 2018 at 10:35 PM, Ahmed Magdy wrote: > I even made sure to read the docs multiple times before posting. :/ > > I've been reading ab

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
That looks like a problem with the version of Python you are running - what version is it? Andrew On Fri, Feb 2, 2018 at 11:36 PM, Ahmed Magdy wrote: > Since you closed the issue, I'm posting here. > Ok, so I've updated asgiref package to 2.1.1 and now getting diffe

Re: Django Channels 2.0.0 groups

2018-02-02 Thread Andrew Godwin
Ah, yes, it looks like aioredis requires at least 3.5.2. I will update the channels_redis readme to make this clear. On Fri, Feb 2, 2018 at 11:44 PM, Ahmed Magdy wrote: > v3.5.1:37a07cee5969 > > On Saturday, February 3, 2018 at 9:41:38 AM UTC+2, Andrew Godwin wrote: >> >&

Re: Channels with django signals

2018-02-03 Thread Andrew Godwin
Hi John, This is fixed in the asgiref master branch, I should be releasing it soon. Andrew On Sat, Feb 3, 2018 at 4:14 PM, John Wayne wrote: > Hi everyone, > > I am trying to send a channels message from a django signal. The problem > ist that the signal function is not async. S

Re: Channels v2.0 - 'RedisChannelLayer' object has no attribute 'ChannelFull'

2018-02-04 Thread Andrew Godwin
Hi, Sorry about this, it was a bug in the group_send method. It's been fixed in channels_redis version 2.0.2. Andrew On Sun, Feb 4, 2018 at 4:19 AM, Ahmed Magdy wrote: > Sending 10~12 messages to the websocket raises an exception > > 'RedisChannelLayer' object has n

Re: Channels websocket disconnecting after ~1min

2018-02-04 Thread Andrew Godwin
Hi there, This is a bug that should be fixed in the latest release of Daphne that I put out a few hours ago. Andrew On Sun, Feb 4, 2018 at 3:49 PM, Ahmed Magdy wrote: > Hello, and sorry for lots of questions about channels. > > I can connect to the websocket from JavaScript and sen

Re: Channels websocket disconnecting after ~1min

2018-02-04 Thread Andrew Godwin
That would be me trying to move deployment to Travis. I'll push it up now. Andrew On Sun, Feb 4, 2018 at 5:47 PM, Ahmed Magdy wrote: > Thanks! > > I don't know if it was on purpose but you forgot to update the pypi > package. > > On Monday, February 5, 2018 at 1:5

Re: django-channels 2.0 websocket connection problem (error 500)

2018-02-05 Thread Andrew Godwin
Have you upgraded to the most recent version of Daphne? There was a bug where tracebacks weren't printing sometimes that I fixed over the weekend. Andrew On Mon, Feb 5, 2018 at 9:21 AM, Alberto Buratti < alberthohenstau...@gmail.com> wrote: > Hello, > I've just installed

Re: channels v2.0.0 disconnect function not triggering

2018-02-06 Thread Andrew Godwin
You are not using it incorrectly - this is a known issue: https://github.com/django/daphne/issues/152 Andrew On Mon, Feb 5, 2018 at 11:53 PM, Ahmed Magdy wrote: > It seems like I cannot get the disconnect function in the consumer to get > called at all. > > class ChatConsumer(Webso

Re: django-channels-2.0 Postgresql Heroku : Operational Error - 'FATAL too many connections for role “usename”'

2018-02-06 Thread Andrew Godwin
This is an open issue in Channels 2, see here: https://github.com/django/channels/issues/871 Andrew On Tue, Feb 6, 2018 at 5:37 AM, Tomiwa Ademidun wrote: > I am running a web application using Django and Django Rest Framework on > Heroku with a postgresql and redis datastore. I am on th

Re: Testing Channels database data missing in Consumer

2018-02-06 Thread Andrew Godwin
I'm not quite sure either. Does the test setup work if you are not in async mode? Andrew On Tue, Feb 6, 2018 at 9:45 AM, Daniel Gilge wrote: > Hi, > > this question is related to Channels 2.0, Django 2.0, pytest 3.4, > pytest-django 3.1 and pytest-asyncio 0.8. >

Re: Django Postgresql Heroku : Operational Error - 'FATAL too many connections for role “usename”'

2018-02-06 Thread Andrew Godwin
This is a known issue: https://github.com/django/channels/issues/871 Andrew On Tue, Feb 6, 2018 at 5:30 AM, Tomiwa Ademidun wrote: > > 0down votefavorite > <https://stackoverflow.com/questions/48644208/django-postgresql-heroku-operational-error-fatal-too-many-connections-for-

Re: Testing Channels database data missing in Consumer

2018-02-07 Thread Andrew Godwin
problem, I have opened a ticket for that: https://github.com/django/channels/issues/880 Andrew On Wed, Feb 7, 2018 at 9:51 AM, Daniel Gilge wrote: > Hi Andrew, > > thanks for your reply. > > This test is passing (using the same packages): > > def test_fixture(db_with_

Re: Channels 2.0 WebSocket demultiplexing

2018-02-07 Thread Andrew Godwin
Hi, It's not yet been re-implemented - here's the issue to track it: https://github.com/django/channels/issues/825 Andrew On Wed, Feb 7, 2018 at 1:53 AM, Daniel Gilge wrote: > Hi, > > how do you demultiplex in Channels 2.0 using WebSockets? > > I want to use a single

Re: Testing Channels 2.0 consumers - problem with routing

2018-02-07 Thread Andrew Godwin
like if it is not. Andrew On Wed, Feb 7, 2018 at 12:16 PM, Azamat Galimzhanov wrote: > Hello, > > I'm setting up an auctions application using channels and websockets. When > I'm running the server the code works just fine, troubles arise when I'm > trying to

Re: Testing Channels 2.0 consumers - problem with routing

2018-02-09 Thread Andrew Godwin
A disconnect() method in your generic consumer takes one argument, a `close_code` - add that in to your function and it will fix it. Feel free to continue problems in this thread, or you can also use GitHub issues on the channels project if you think they're actual bugs! Andrew On Fri,

Re: Testing Channels 2.0 consumers - problem with routing

2018-02-11 Thread Andrew Godwin
Hi, This is a known issue with the Redis backend - https://github.com/django/channels/issues/859 I am looking at it today. Andrew On Sun, Feb 11, 2018 at 8:54 AM, Azamat Galimzhanov wrote: > After fixing this issue, here is the updated consumer: > > > from functools import lru_ca

Re: How many live websocket connection can django channels handle?

2018-02-13 Thread Andrew Godwin
r call which is more expensive - more server power or the extra development time needed. There's no baseline "number" that Daphne/Channels can terminate without reference to exact hardware. Andrew On Tue, Feb 13, 2018 at 3:52 PM, John Conner wrote: > I'm working on a pr

Re: Django Channels 2 Group_send to channel layer causes runtime error: "got Future attached to a different loop"

2018-02-16 Thread Andrew Godwin
Can you update your versions of `asgiref` and `channels_redis` please? I fixed those bugs a couple of days ago. Andrew On Fri, Feb 16, 2018 at 10:48 AM, Luke Hebert wrote: > Trying to call the "alert_receive" consumer method > > import json > from channels.consumer impo

Re: Handle changing users (e.g. a logout) in a scope/WebSockets

2018-02-18 Thread Andrew Godwin
vironments will cause them. Andrew On Sun, Feb 18, 2018 at 10:59 PM, Daniel Gilge wrote: > Packages: Channels 2.0, Django 2.0 > > Hi, > > When I understand it correctly a scope’s user object isn’t updated when a > user changes (e.g. logs in or out in another window) for the w

Re: [django-channels] Running multiple daphne servers

2018-02-19 Thread Andrew Godwin
he channel layer instead. Andrew On Mon, Feb 19, 2018 at 8:34 AM, Tomáš Ehrlich wrote: > Hello everyone, > I'm running two instances of Daphne on my server (one per environment, > production/staging). > I'm using UNIX sockets behind nginx, but production requests are

Re: DjangoUnleashed-2.0

2018-02-23 Thread Andrew Pinkham
following along with the book, but to give Choice 1 a whirl (after reading Django's documentation) on a new project as it's easier to read. I hope this helps! Andrew http://jambonsw.com http://django-unleashed.com -- You received this message because you are subscribed to the Google

Re: Channels worker and call_later

2018-02-23 Thread Andrew Godwin
f.task = loop.create_task(coroutine_function()) Hope that helps! Andrew On Fri, Feb 23, 2018 at 7:48 PM, Ken Whitesell wrote: > TLDR: Is there a way to use the call_later function within a worker task? > (Or am I just looking at this issue the wrong way?) > > Software - Python 3.6, Django 2.0.2,

Re: Channels 2.0 - Exception when sending a message to client

2018-02-24 Thread Andrew Godwin
sort have worked in Channels 1, but in Channels 2, the only consumer that can send to a websocket is the one that's attached to it. All anything else can do is send messages over the channel layer to the websocket consumer to trigger _it_ to run code and send something. Andrew On Sat, Feb

Re: [django-channels] Testing events from post_save signal

2018-02-25 Thread Andrew Godwin
I think the change you need to make is swapping in database_sync_to_async rather than sync_to_async - see here: http://channels.readthedocs.io/en/latest/topics/databases.html Andrew On Sun, Feb 25, 2018 at 7:14 AM, Tomáš Ehrlich wrote: > Here's the gist (https://gist.github.com/tr

Re: [django-channels] Testing events from post_save signal

2018-02-25 Thread Andrew Godwin
No problem - glad everything else seems to work alright! Getting async testing working well has been a long, hard road :) Andrew On Sun, Feb 25, 2018 at 10:37 AM, Tomáš Ehrlich wrote: > Of course! > > It works now perfectly, thank you. Sorry I missed that in docs. > > Cheers,

Re: Disconnect WS on server shutdown

2018-02-26 Thread Andrew Godwin
At the moment there is not - you should follow this issue: https://github.com/django/daphne/issues/177 On Mon, Feb 26, 2018 at 9:37 AM, Igor Partola wrote: > I am running into an issue with one of my applications that is running on > Heroku. Basically during a deploy, the old daphne process gets

Re: Channels 1.x

2018-02-27 Thread Andrew Godwin
Yes, there is one session made per connection. They should expire and get cleaned up like normal HTTP sessions if you run the session cleanup in Django (or use backends that auto-cleanup) Andrew On Tue, Feb 27, 2018 at 11:00 AM, nferrari wrote: > Hello, > > I'm using django-cha

Re: django-channels: WebSocketBridge options

2018-02-28 Thread Andrew Godwin
Hi Nicolas, It's likely just an oversight in the coding. We're actually in the process of removing official support for that JavaScript code as we have nobody to maintain it, so I suggest you either clone it and modify it yourself or use ReconnectingWebSocket directly. Andrew On W

Re: Channels: channel_layer appears to time out

2018-03-01 Thread Andrew Godwin
Hi Toby, Do you have the latest versions of daphne, channels, asgiref and channels_redis? This sounds supiciously like a bug I fixed a couple weeks ago. Andrew On Thu, Mar 1, 2018 at 5:45 AM, wrote: > Hello, > > I have a project that uses Channels as a worker queue, with a SyncConsum

Re: Channels 2: Consumer running twice when two users simultaneously share socket

2018-03-01 Thread Andrew Godwin
Can you clarify what you mean by "two users connected to the same socket"? If you have two websockets connected, you'll have two copies of your consumer running, one for each socket. Andrew On Thu, Mar 1, 2018 at 7:52 AM, lakeshow wrote: > I am running into an issue using Cha

Re: Channels 2: Consumer running twice when two users simultaneously share socket

2018-03-01 Thread Andrew Godwin
you get 2 saves, etc.) I'd recommend saving instead where you send to the group. Andrew On Thu, Mar 1, 2018 at 10:02 PM, lakeshow wrote: > Sure. The JS code is essentially identical to your example. By "two users > connected", I simply meant two users have clicked to join in

Re: Django Channels AuthMiddleware question

2018-03-03 Thread Andrew Godwin
could fix this (it might mean making it non-lazy, but I don't quite know yet). The SessionMiddleware does have the problem you suggest, though - I have opened this issue to track it: https://github.com/django/channels/issues/949 Andrew On Sat, Mar 3, 2018 at 5:49 PM, Hugo Castilho wro

Re: Django Channels AuthMiddleware question

2018-03-04 Thread Andrew Godwin
This is a problem with _any_ ASGI app, not just middleware - doing blocking things in the __init__ is bad. I will look at the docs when I look at solving the SessionMiddleware problem as well, as the two are linked. Andrew On Sun, Mar 4, 2018 at 7:10 AM, Hugo Castilho wrote: > > > Th

Re: How do I transmit any changes to databases(i.e. creates and updates pertaining to a particular user) using Django Channels?

2018-03-08 Thread Andrew Godwin
n a save method) here: https://github.com/andrewgodwin/channels-examples/tree/master/multichat Andrew On Thu, Mar 8, 2018 at 7:35 AM, Alexis Candelaria < alexiscandelar...@gmail.com> wrote: > My goal is to send send any database updates to the relevant users. I was > thinking of utilizin

Re: Printing to console from async method inside django channels

2018-03-09 Thread Andrew Godwin
Hi Chris, Since you also posted this to GitHub ( https://github.com/django/channels/issues/967), I will answer there. Andrew On Thu, Mar 8, 2018 at 8:17 PM, Chris Barry wrote: > I'm trying to print inside these methods in from this example in django > channels: > > h

Re: Listening to a django channel from outside a consumer

2018-03-13 Thread Andrew Godwin
within an async context rather than using async_to_sync, but I believe both should work. Andrew On Tue, Mar 13, 2018 at 12:15 AM, Alex wrote: > Hi, > > > The docs explain that it is possible to publish to the channel layer from > outside of a consumer: https://channels.read

Re: separate http requests between channels routing and "classic django routing

2018-03-13 Thread Andrew Godwin
You can just use channels.http.AsgiHandler as the consumer/ASGI app to hand off to Django views. It's mentioned in the last paragraph here: http://channels.readthedocs.io/en/latest/topics/routing.html#protocoltyperouter Andrew On Tue, Mar 13, 2018 at 9:20 AM, Kevin Tewouda wrote: > He

Re: separate http requests between channels routing and "classic django routing

2018-03-14 Thread Andrew Godwin
ust a prefix. Andrew On Wed, Mar 14, 2018 at 2:13 AM, Kevin Tewouda wrote: > Thanks Andrew > i found the mistake myself, my routing file was like this > > http_urlpatterns = [ > path('stream', ServerSentEventsConsumer), > path('', AsgiHandler) &

Re: Is anyone using Channels 2 and asgi_rabbitmq?

2018-03-19 Thread Andrew Godwin
Hi Filbery, asgi_rabbitmq has not been ported to work with the new asynchronous channel layer API in Channels 2 yet, so it's not compatible, I'm afraid, and nobody is currently working on that port as far as I know. Andrew On Mon, Mar 19, 2018 at 8:13 AM, Filbert wrote: > M

Re: Django 2.0 and AsgiRequest Error

2018-03-20 Thread Andrew Godwin
Hi - did you also open this issue on GitHub: https://github.com/django/channels/issues/981 ? In either case, your MIDDLEWARE setting would be useful, this looks like a middleware is not running. Andrew On Tue, Mar 20, 2018 at 2:47 PM, G Broten wrote: > Django Users: > I've do

Re: Overriding channel-layer's group_send and group_add to add persistence

2018-03-23 Thread Andrew Godwin
It looks correct at first glance - I would insert a debugger there and see what the Redis database contained manually at that point. Andrew On Fri, Mar 23, 2018 at 2:56 AM, 'Alex' via Django users < django-users@googlegroups.com> wrote: > I've been trying to add persi

Re: channels and middlewares

2018-03-23 Thread Andrew Godwin
Check your Django version - MIDDLEWARE_CLASSES is deprecated, you should be using the new MIDDLEWARE setting. Andrew On Fri, Mar 23, 2018 at 8:56 AM, Matteo Lucchesi wrote: > It' possible that running a django application with channel2 ingores my > MIDDLEWARE_CLASSES over HTTP? &

Re: Overriding channel-layer's group_send and group_add to add persistence

2018-03-23 Thread Andrew Godwin
I would check the connection is going to the right server/database as well? But past that, I can't help you - I'd try doing some things with plain aioredis to see if you can replicate it there. Andrew On Fri, Mar 23, 2018 at 9:01 AM, 'Alex' via Django users < django-users@

Re: Django channels 2 and data binding

2018-03-24 Thread Andrew Godwin
te it later in the year. Andrew On Sat, Mar 24, 2018 at 7:07 PM, Fabio Andrés García Sánchez < fabio.garcia.sanc...@gmail.com> wrote: > Is there any example about how to use data binding with django channels? I > could not find any source to insertando how to do it. > > -- >

Re: Django channels 2 and data binding

2018-03-25 Thread Andrew Godwin
You can write most of the data binding functionality yourself in Channels 2 by adding group send methods to model save methods, but if Channels 1 is working for you right now, I wouldn't move until you're forced to. Andrew On Sat, Mar 24, 2018 at 11:07 PM, Fabio Andrés Garc

Re: Django Channels 2 poor performance and high CPU usage

2018-03-26 Thread Andrew Godwin
o use of groups or the channel layer at all and see how that performs, to narrow down where the performance issue lies. Andrew On Mon, Mar 26, 2018 at 6:15 AM, James wrote: > I'm using Channels 2 to build a shared 3D model viewing tool, but I'm > running into performance issues

Re: Django Channels 2 poor performance and high CPU usage

2018-03-27 Thread Andrew Godwin
Not getting past HANDSHAKING with the in-memory layer is a bit weird, and scope is just a normal Python dictionary. Is it possible to put your code up somewhere in a simple form so I can look over it? Andrew On Tue, Mar 27, 2018 at 4:11 AM, 'James Foley' via Django users <

I am trying to create a django project with a custom model that has two diffrent user profiles.it seems to have set a default profile i want to be able to choose one profile from a user

2018-03-28 Thread Andrew Korir
from django.db import models from django.contrib.auth.models import AbstractUser,UserManager from django.db.models.signals import post_save from django.dispatch import receiver # Create your models here. class CustomUserManager(UserManager): pass class CustomUser(AbstractUser): pass class LecP

Re: Does Daphne of Django Channels send out a heartbeat to keep the connection alive?

2018-03-29 Thread Andrew Godwin
ets behave. Andrew On Thu, Mar 29, 2018 at 7:52 AM, lakeshow wrote: > Is this even done server side? Or does it need to be implemented with js > for the client? > > I ask because it appears that my connection repeatedly before or during > the attempt to connect. It only happens

Django ORM Handling of Reverse Relationships and Multi-Value Relationships

2018-03-29 Thread Andrew Standley
uot;id", "test_app_related"."field" FROM "test_app_ related" INNER JOIN "test_app_main" ON ("test_app_related"."id" = "test_app_ main"."related_id") INNER JOIN "test_app_main" T3 ON ("test_app_related&q

Re: Django ORM Handling of Reverse Relationships and Multi-Value Relationships

2018-03-29 Thread Andrew Standley
So sorry everyone. I meant to post this to the development mailing list. Apparently I haven't had enough coffee today. Please disregard. On Thursday, March 29, 2018 at 2:15:33 PM UTC-7, Andrew Standley wrote: > > I have recently become acquainted with some ORM behaviour

Re: Getting channels 2 to work

2018-03-30 Thread Andrew Godwin
That code would be for Channels 1. Channels 2 is an entirely different import set - make sure you are using tutorials or answers specifically for 2. Andrew On Thu, Mar 29, 2018 at 4:52 PM, Luke Waltman wrote: > Hello Everyone, > > I am still having an issue with Channels that was nev

Re: [django-channels] Which process sends message to all channels in a group during group_send?

2018-03-30 Thread Andrew Godwin
When you do a group send, the message doing the sending fans out the send to all the target channels (currently using individual commands, and soon with a Lua script inside Redis). We're not using redis pub-sub - we use lists instead. Andrew On Fri, Mar 30, 2018 at 2:26 AM, krdeepak

Re: When deleting field in models admin form not updating.

2018-03-30 Thread Andrew Korir
have you tried to run migrations on that particular app in your django project python manage.py makemigrations app_name python manage.py migrate app_name On Fri, Mar 30, 2018 at 4:27 PM, Gerald Brown wrote: > I am using Django 2.0.3 and Python 3.6. When I delete a field in the > model file it

Re: Channels 2.0 max number of connections

2018-04-04 Thread Andrew Godwin
It depends on your server and how busy the connections are. If you need more you should run more instances of Daphne. Andrew On Wed, 4 Apr 2018, 05:21 Алексей Кузуб, wrote: > Hello! How many connections Channels 2.0 can handle and keep open > simultaneously? And how should I configure

Re: Channels 2.0 max number of connections

2018-04-04 Thread Andrew Godwin
No, there is no hard limit programmed into Daphne. It will keep accepting as long as it can. Andrew On Wed, Apr 4, 2018 at 11:30 PM, Алексей Кузуб wrote: > But no limit in params or in some other place? > > среда, 4 апреля 2018 г., 20:00:11 UTC+3 пользователь Andrew Godwin написал:

Re: Mysql is gone away auth middleware channels 2

2018-04-05 Thread Andrew Godwin
You must do all database access through a synchronous function wrapped in database_sync_to_async - you can't just call it directly on an asyncio thread: http://channels.readthedocs.io/en/latest/topics/databases.html#database-sync-to-async Andrew On Thu, Apr 5, 2018 at 5:25 AM, Matteo Luc

Re: Using channels, how to send a notification to single user by model changed trigger event?

2018-04-07 Thread Andrew Godwin
Make a Group per user, and then send to that group. You should treat a user as a group as they may have multiple windows or tabs open. Andrew On Sat, Apr 7, 2018 at 7:02 AM, wrote: > This example <https://github.com/andrewgodwin/channels-examples> showed > in django project how to

Re: wrong imports channel ?

2018-04-12 Thread Andrew Godwin
Channels 2 has different objects and import paths - code from Channels 1 (like you have there) isn't compatible. Andrew On Thu, Apr 12, 2018 at 12:37 AM, Jules LE BRIS wrote: > Hi, > > I would like to do something like this in views.py : > > message = {"message&quo

Re: Django Channels also works when I have no Worker running.

2018-04-17 Thread Andrew Godwin
Channels 2 does not run requests in workers. Workers are now only for running background tasks on specific channels, and so you do not need them normally. Andrew On Tue, Apr 17, 2018 at 6:54 AM, Christopher Wittlinger < cwittlinge...@gmail.com> wrote: > I think I misunderstood the c

<    1   2   3   4   5   6   7   8   9   10   >