Re: Architecting a Crypto Market Data Feed using Django Channels

2018-04-28 Thread Andrew Godwin
x27;t use up a thread and potentially block the server, or rework it to put the feed events onto the channel layer from an external process. Andrew On Sat, Apr 28, 2018 at 1:12 AM, Michael wrote: > Hi, > > What is the best way to architect a Django Channels app that provides a > ver

Re: Channels 2: Consumer lifecycle when run in a worker process

2018-05-02 Thread Andrew Godwin
instance you have is completed - because there's a different instance for each message, that means "raise when you've finished processing the message". Nothing happens to other messages as they're being handled by different instances. Andrew On Wed, May 2, 2018 at 7:50 AM A

Re: Channels 2: Consumer lifecycle when run in a worker process

2018-05-02 Thread Andrew Godwin
erent-named channels. Andrew On Wed, May 2, 2018 at 11:51 AM Alexander Prokhorov wrote: > Andrew, thank you for quick response! > > Unfortunately I see something different. If I raise `StopConsumer` after > processing a single message, the next one is lost. From the code > https

Re: Channels 2: Consumer lifecycle when run in a worker process

2018-05-02 Thread Andrew Godwin
At the level of abstraction of the Worker, you can't prevent it pulling more messages off the queue - if you want that level of control, you would have to subclass it and change the logic yourself, I imagine. Andrew On Wed, May 2, 2018 at 1:12 PM Alexander Prokhorov wrote: > > Inde

Fixtures: core.serializers.sort_dependencies sorts models in the wrong order for FK constraints

2018-05-04 Thread Andrew Wrigley
Hi all, I'm trying to dump a database fixture, and load it again to run tests. When I run `python manage.py test`, I get: > IntegrityError: Problem installing fixtures: insert or update on table > "publisher_journaldupextid" violates foreign key constraint > "publisher_journaldup_journa

Re: Django-channels request depending Middleware

2018-05-04 Thread Andrew Godwin
re, in the authentication docs: http://channels.readthedocs.io/en/latest/topics/authentication.html#custom-authentication Andrew On Fri, May 4, 2018 at 6:12 AM Marius Räsener wrote: > Hey everybody, > > We are using a Middleware to inject postgresql schemas into queries based > on a sub

Re: Fixtures: core.serializers.sort_dependencies sorts models in the wrong order for FK constraints

2018-05-06 Thread Andrew Wrigley
't be deserialised without violating FK constraints. Maybe this is a bug? I could --exclude thing, or manually control the serialisation order, but I'm hoping there is a more obvious solution I'm missing. On Sunday, May 6, 2018 at 7:30:31 AM UTC+2, Mike Dewhirst wrote: > > On 5/05/20

Re: Django Channels client not consuming

2018-05-15 Thread Andrew Godwin
Hi, I'm afraid you're using incredibly old versions of Channels and the bugs you're encountering are almost certainly fixed in more recent releases. I'm not sure there's much I can do. Andrew On Tue, 15 May 2018, 13:01 LEEPS Lab, wrote: > We have an issue implem

Re: Django channels with python background tasks

2018-05-26 Thread Andrew Godwin
Script, but anything you can do with it can also be done slower using a polling API connection. My recommendation would be to start simple - doing it using an API that you poll every few seconds - and then once you have that figured out, look at how you could improve it using WebSockets and channels.

Re: How to test a WebsocketConsumer that has async_to_sync code in it

2018-06-06 Thread Andrew Godwin
Hi - I will reply on the ticket, as I'll be requesting you paste a large chunk of code and the formatting is better over there! Andrew On Wed, Jun 6, 2018 at 12:26 PM 'Artemis' via Django users < django-users@googlegroups.com> wrote: > I cannot test my *WebsocketConsume

Re: hanging django/postgres idle connections

2016-04-28 Thread Andrew Grigorev
Same problem with postgis database backend when running a development server. среда, 30 июля 2014 г., 17:41:58 UTC+3 пользователь Jani Kajala написал: > > Hi, > > I have a problem with leaking Postgres DB connections even if I > have CONN_MAX_AGE=0. Every time I start the server and stop it by

Re: "canonical" views.py in Django Unleashed book, Chapter 22

2016-06-30 Thread Andrew Pinkham
#L114 I'm not super sure what you were looking at, or where the confusion occurred, but I would be open to your feedback about what you were seeing and how you got there, so that I may help others better get the code examples (as I spent *a lot* of time making the repo as cleans as possible g

deprecated urls as strings: problem adding second + urls to main urls.py file

2016-08-06 Thread Andrew Emory
I am having trouble with how I would intuitively get my url patterns to work, by listing the actual path to the view function. So it needs to be a callable, ok. But I don't like having 15+ from appname import views as appname_view. I can add a url.py file in each app and use include(). But t

Re: deprecated urls as strings: problem adding second + urls to main urls.py file

2016-08-06 Thread Andrew Emory
don't like the > look of it, but that's Python. > > On Saturday, August 6, 2016 at 8:42:29 AM UTC-4, Andrew Emory wrote: >> >> I am having trouble with how I would intuitively get my url patterns to >> work, by listing the actual path to the view function

Re: Trying to set up a website using Django but something went wrong

2016-08-06 Thread Andrew Emory
Do you have Python installed? On Saturday, August 6, 2016 at 11:03:06 AM UTC-5, owen wrote: > > I downloaded Django recently and I have all the necessary files (Or at least > I think I do ) > > > However when I try to set up a project through this line of code: > > > $ django-admin startproject m

Re: Help with django form an ajax, error 500

2016-08-10 Thread Andrew Beales
Guessing this is old news, but there are 2 problems with views: ProductoConcepto.objects.create(producto=producto, orden=orden, cantidad=cantidad) - producto and orden need to be Python objects and cantidad is a float, but the request.POST values will be string representations. Also the ajax

TemplateDoesNotExist at/

2016-08-13 Thread Andrew Emory
I am having a problem figuring this out and I think there is something wrong with my TEMPLATES dictionary in settings.py. I have my templates in static/templates/app_name and static is in the same directory as my project source. So I have nested os.path.join and os.path.dirname as follows:

Re: How t o create more than one application

2016-08-13 Thread Andrew Emory
Just enter the command: python manage.py startapp app_name from your terminal window in the projects source directory. On Friday, August 12, 2016 at 7:37:10 PM UTC-5, Timothy Steele wrote: > > > > down votefavori >

Re: TemplateDoesNotExist at/

2016-08-13 Thread Andrew Emory
Actually, its Django 1.9. -- 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 django-

Re: TemplateDoesNotExist at/

2016-08-13 Thread Andrew Emory
I figured it out. Of course, now the form isn't rendering... But at least Django isn't throwing that error anymore. for all those who are curious, I was one directory shallow on the template file's location. I was telling Django to look in static/templates when I needed to tell it to look in

forms.Form, models.Model, forms.ModelForm? (self.django)

2016-08-14 Thread Andrew Emory
Would someone explain to me when you would choose one class over the other? Does forms.Form not create a database? Can't you just render models.Model as a form? I understand forms.ModelForm is a helper class for creating a form from a model. But I still don't really understand why you would

Re: forms.Form, models.Model, forms.ModelForm? (self.django)

2016-08-14 Thread Andrew Emory
opinion, but those are the broad strokes. > > On Sun, Aug 14, 2016 at 2:04 PM, Andrew Emory > wrote: > >> Would someone explain to me when you would choose one class over the >> other? Does forms.Form not create a database? Can't you just render >> models.Mode

What happened to my admin? AttributeError: 'WSGIRequest' object has no attribute 'user'

2016-08-14 Thread Andrew Emory
Django 1.9. Everything seems to be set up properly. I was having some issues with my templates but got them working. I didn't touch any admin or even any login stuff. Though my template does have a {% csrf_token %}. I can't imagine how this happened. >From Googling it seems like it was a

Re: New to Django

2016-08-16 Thread Andrew Beales
Hi, you can use aggregation queries to count the child images connected to each server: # views.py from django.db.models import Count def servers(request): servers = Server.objects.all() for server in servers: server.child_images = server.images.aggregate(total=Count('base'))

Re: New to Django

2016-08-16 Thread Andrew Beales
All this talk about "child images on servers" has probably set off an alarm somewhere. On Wednesday, August 17, 2016 at 7:00:09 AM UTC+1, Andrew Beales wrote: > > Hi, you can use aggregation queries to count the child images connected to > each server: > > > # views.

MIDDLEWARE vs MIDDLEWARE_CLASSES: 'WSGIRequest' object has no attribute 'user'

2016-08-17 Thread Andrew Emory
My settings.py file has the default MIDDLEWARE settings generated by django-admin startapp: MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.

Re: New to Django

2016-08-20 Thread Andrew Beales
This works for me: {% for server, images in child_list.items %} {{ server }} {% for image in images %} {% for key,val in image.items %} {{ key }}: {{ val }} {% endfor %} {% endfor %} {% endfor %} In your template, 'image' is a list of dicts, so you need to loop o

Model Field: field.editable

2016-10-07 Thread Andrew Emory
I am having trouble finding out how this field renders. The behavior that I want is basically if the user clicks a radio button to true than a form field is displayed for more info, if they click false then nothing needs to happen. Is this the model field that I want? Or do I just need a boole

Re: Model Field: field.editable

2016-10-07 Thread Andrew Emory
NVM, that is a field option. Still though, can anyone suggest the model field to use? On Friday, October 7, 2016 at 8:11:59 PM UTC-5, Andrew Emory wrote: > > I am having trouble finding out how this field renders. > > The behavior that I want is basically if the user clicks a rad

Re: Model Field: field.editable

2016-10-07 Thread Andrew Emory
I figured it out. It would be a boolean field followed by (in my case) a CharField. You would get the conditionality w/ JS. On Friday, October 7, 2016 at 8:11:59 PM UTC-5, Andrew Emory wrote: > > I am having trouble finding out how this field renders. > > The behavior that I want

Re: Django Channels

2016-10-16 Thread Andrew Godwin
o build an application on top of, you'll have to write your own Python and Javascript around it. Andrew On Sunday, October 16, 2016 at 9:43:36 AM UTC-7, Amirtpal wrote: > > Hi Django folks, > > Just a couple of questions on using Django Channels > > a) Assuming I have re

Form input: "unlimited list," what does the backend look like?

2016-10-18 Thread Andrew Emory
I want to get user data where is use a ChoiceSelect field. And if the user selects an option another one pops up giving them the same choices again. I understand that I would do this with JavaScript on the front end. But, it is unclear to me what kind of architecture and model fields I should

Am I missing a design pattern? My views code somehow isn't as elegant as it should be...

2016-10-21 Thread Andrew Chiw
In my views, I have this: def questionnaire(request): def save_the_lead(cleaned_data, ipinfo): email = cleaned_data.pop('email', None) lead, created = Lead.objects.update_or_create(email=email) lead.q = cleaned_data lead.ipinfo = ipinfo lead.save()

Re: Am I missing a design pattern? My views code somehow isn't as elegant as it should be...

2016-10-21 Thread Andrew Chiw
As someone POSTs a questionnaire, I lookup some additional info about the IP and save that into a model's JSONField. I'm sending the request into django-ipware's get_ip(), which will return the IP address as a string. Since this data is ephemeral, I put it directly in the constructor instead of

Silently continuing past an exception: is this proper? how else can I do this?

2016-10-23 Thread Andrew Chiw
I've got my models setup in Django where a Document is a model that can be related to a Transaction. Now I'd like to make a DocumentForm with a dropdown of Transactions owned by the current Client, so that a client can say that this Document is related to this Transaction. So I wrote some code

Re: Silently continuing past an exception: is this proper? how else can I do this?

2016-10-23 Thread Andrew Chiw
It seems there's a problem with my code, because you're just supposed to pass a dict to DocumentForm (or any modelForm really), not a model instance. I actually want to make a DocumentForm initialized with values from an existing Document, so I can list existing Documents and provide a way to r

Re: "canonical" views.py in Django Unleashed book, Chapter 22

2016-10-23 Thread Andrew Pinkham
a general software practice: Why reinvent the wheel when it's available to you? Andrew http://jambonsw.com http://django-unleashed.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: Django Unleashed, custom user model

2016-10-23 Thread Andrew Pinkham
jects/cannon/jamf$ python manage.py make > migrations account It looks like you changed the name of the user domain to account (I assume this is the same as user; there is no account domain in the book). Are you also changing the name of the domain in the code and the commands in the book? If

Re: How to handle Video/Audio streaming using Django Channels?

2016-11-04 Thread Andrew Godwin
Hi Sandro, Could you highlight what the problems you're facing are? Channels is not particularly designed for streaming large files - you're better doing that using a CDN or dedicated file streaming software - so I'd be curious to know what the particular issues you're facing

Re: How to handle Video/Audio streaming using Django Channels?

2016-11-04 Thread Andrew Godwin
o the way it's designed. Really, to do something like this properly would require native WebRTC support in Channels, and we don't have that (yet). I'd suggest looking into other software solutions to relay video streams instead. Andrew On Fri, Nov 4, 2016 at 6:09 PM, Sandro Salles

Re: Running daphne in production - Mac OS X Server 10.11

2016-11-10 Thread Andrew Godwin
ent port to the WebSocket source URL (by default it's trying the same port as the page it's served on) Andrew On Thu, Nov 10, 2016 at 12:24 PM, Adam Teale wrote: > Hi everyone, > > I am looking into Andrew Godwin's example project "channels-example" ( > https:/

Re: Running daphne in production - Mac OS X Server 10.11

2016-11-10 Thread Andrew Godwin
webserver (sounds like Apache for you) proxy all requests to this port * Optionally: Make apache either proxy or use mod_wsgi based on path prefix Andrew On Thu, Nov 10, 2016 at 12:48 PM, Adam Teale wrote: > Hi Andrew, > > Thank you very much for you help. > > Can you direct me to

Re: Running daphne in production - Mac OS X Server 10.11

2016-11-11 Thread Andrew Godwin
e a mod_proxy_wstunnel you can use, though. Andrew On Fri, Nov 11, 2016 at 7:45 AM, Adam Teale wrote: > I came across a post that suggested running Daphne like this: > > daphne multichat.asgi:channel_layer --port 8000 -v 2 > > > The updated error: > > > 2016-11-11 1

Drawing with Django

2016-11-13 Thread Andrew Stringfield
hello all, I am interested in being able to draw on a Django view. I have been reading up some on how people draw in Html and it seems that the tag seems to a good start. Apparently I have to do some java scripting as well. What I envision is that I have a background image and then my

Re: Drawing with Django

2016-11-13 Thread Andrew Stringfield
y the image. Get all the annotation for the image, > display dot at the position of each annotation, display the text on > mousehover. Or directly on the image if the image is huge. > > Good luck > > 2016-11-13 21:48 GMT+01:00 Andrew Stringfield >: > > hello all, >

Re: Can I use Django Channels to solve this architectural prolem?

2016-11-15 Thread Andrew Godwin
client joins, so you'd have to fill in that gap. In the end, you're probably looking at some sort of datastore in the middle there to store logs and then replay them into a socket as it joins. Andrew On Tue, Nov 15, 2016 at 2:27 PM, wrote: > Hi there, > > I want to develop

Re: What is the use of parent_template filter in Django templates

2016-11-16 Thread Andrew Pinkham
k, Thanks for buying my book! The first time we use parent_template---a variable, not a template tag---is on page 108 of the book. The paragraph before Example 4.53 provides a full explanation of why I opt to use a variable with a default, rather than a magic (read: hardcoded) string. Hope that

Re: I don't understand the second paragraph on the Getting Started with Channels documentation

2016-11-17 Thread Andrew Godwin
Yes, this means "once you have installed channels", since it's in the channels documentation. I'll update that line to mention "with channels". Andrew On Thu, Nov 17, 2016 at 2:13 PM, wrote: > When you run Django out of the box, it will be set up in the d

Re: Can I use Django Channels to solve this architectural prolem?

2016-11-18 Thread Andrew Godwin
On Fri, Nov 18, 2016 at 6:57 AM, wrote: > Hi Andrew, thanks for the advice. Since I implement websockets to serve my > users the live logs, I would just route the service commands (e.g. > "service.start") through the websocket, too. That way I also don't have to &g

Re: Channels: startup order of daphne and workers leads to issues

2016-11-23 Thread Andrew Godwin
ering Andrew On Tue, Nov 22, 2016 at 3:16 PM, Alex Peitsinis wrote: > Hello, > > I noticed a weird thing during a deployment of a service that uses > channels at work the other day. We use docker, so we have a container for > daphne and a container for workers (currently 4). We

Re: Structure for deploying django channels in producting in AWS

2016-11-27 Thread Andrew Godwin
? Have you tried swapping in another container with something else on port 8000 to see if that works? This sounds like a networking issue that's not really specific to Daphne. Andrew On Sun, Nov 27, 2016 at 4:06 AM, Vaisagh Viswanathan wrote: > Hi, > > I'm trying to setup up m

Re: Django and asynchronous tasks

2016-11-30 Thread Andrew Godwin
webpage, you'll need the reply_channel name that points to an open socket connected to that page, or have connected the socket to a group when it connected and send to that group, and write your own javascript on the client end to handle it. Andrew On Tue, Nov 29, 2016 at 11:44 PM, Alain Mu

Re: Channels, Websockets and 'Backpressure'

2016-12-01 Thread Andrew Godwin
ly in the meantime if you wish (there's one list per channel). Andrew On Thu, Dec 1, 2016 at 11:26 AM, hanks...@gmail.com wrote: > Can someone help me understand the concept of websocket “backpressure” in > a Django Channels project? What is it? How do diagnose it? At what level of

Re: Channels, Websockets and 'Backpressure'

2016-12-01 Thread Andrew Godwin
On Thu, Dec 1, 2016 at 12:48 PM, Hank Sims wrote: > Thanks, Andrew. A few follow-up questions: > > 1. How would one go about increasing the default maximum queue size? I saw > some reference to this when I was researching the problem yesterday, but I > couldn't find the setti

Re: Channels, Websockets and 'Backpressure'

2016-12-01 Thread Andrew Godwin
ull will raise the ChannelFull exception. What you're seeing is the inbound channel filling up, and the ASGI spec says that websocket protocol servers should drop the connection if they can't send an incoming message from a socket. Andrew -- You received this message because you are s

Re: Websocket connection failed in production with Django-Channels

2016-12-05 Thread Andrew Godwin
For future reference, this discussion is also happening here: https://github.com/django/channels/issues/445 On Mon, Dec 5, 2016 at 2:04 AM, yass45 wrote: > Hello, > > > I try to use Django Channels on my website developed with Django 1.10 and > Python 3.5. This website is hosted on Webfaction. >

Re: how to customize ASGI ChannelLayer ?

2016-12-15 Thread Andrew Godwin
No, that's not what a channel layer is meant to do - it's for short term buffering (messages expire after a minute by default). I suggest you use a database. Andrew On 15 Dec 2016 17:53, "wang sheng" wrote: > I an developing a chat app, while some user is offline, I

Re: Understanding django channels persistant data

2016-12-20 Thread Andrew Godwin
running on a different server, so you have to use the session to persist data (such as room). > @channel_sessiondef ws_disconnect(message): > Group("chat-%s" % > message.channel_session['room']).discard(message.reply_channel) > > Q3. Same like above, why are we not u

Re: Understanding django channels persistant data

2016-12-20 Thread Andrew Godwin
> > And there's just this another confusion, why can't we us *"text": > message.content['text']*, but instead its *"text": message['text']*? > Both are valid; there's a shortcut for message.__getitem__ that just calls message.content.__getitem__

Re: Django Channels - WebSocket connection to 'wss://mysite.local/chat/stream/' failed: WebSocket is closed before the connection is established. response code: 200

2016-12-22 Thread Andrew Godwin
Apache's default mod_proxy does not support WebSockets. If you want to keep using Apache I would consider looking at mod_proxy_wstunnel. Andrew On Thu, Dec 22, 2016 at 2:24 PM, Adam Teale wrote: > Hi everyone, > > I have a django app running on mac os x server via mod_wsgi (apac

Re: Dynamic querysets?

2016-12-23 Thread Andrew Beales
You can pass strings from URLs as arguments into your Django view functions. Assuming your Jurisdiction model already has a "name" field, make sure it also has a "postal_code" field (consider renaming the model State?) Your urls and views can be something like: # urls.py url(r'^(?P[A-Z]{2})', v

Re: Dynamic querysets?

2016-12-23 Thread Andrew Beales
typo: # urls.py url(r'^(?P[A-Z]{2})', views.state_home, name="state_home"), On Saturday, December 24, 2016 at 7:35:12 AM UTC, Andrew Beales wrote: > > You can pass strings from URLs as arguments into your Django view > functions. > > Assuming your Jurisdicti

Re: How to display user's photo that i follow in post's list in Django

2016-12-27 Thread Andrew Beales
If I'm following correctly and you want to access author profile photos from querysets of Post objects: if you add related_name=‘profile’ to the user field in the Profile model then you can add a method to the Post model: def author_profile_photo(self): return self.author.profile.photo and

Re: Django-Channels strange slowdowns - how to profile?

2016-12-29 Thread Andrew Godwin
"]). 2) Directly make HTTP requests on the server running Daphne to it via localhost with a similar round trip measurement. Something like `ab` works well for this; remember to either target a very simple view or compare it with a similar test using a WSGI server. Andrew On Wed, Dec 28, 2016

Re: How to pass data between Django module/app functions without using database in asynchronous web service

2016-12-29 Thread Andrew Godwin
Hi Ken, I'm mostly clear on what's happening here (you should definitely not use global variables for the reasons you mention), but I have a few questions to try and clear things up: - Are the websocket and the AJAX calls going to different clients/pages entirely, rather than them both being in t

Re: Django-Channels strange slowdowns - how to profile?

2016-12-30 Thread Andrew Godwin
Wow, that's an incredibly slow network you have there. I would agree that you should move them all to the same place; I would say you want no more than 10ms latency (0.01s) to your Redis server in a case like this. Andrew On Thu, Dec 29, 2016 at 2:31 PM, wrote: > I've prepare

Re: How to pass data between Django module/app functions without using database in asynchronous web service

2017-01-01 Thread Andrew Godwin
27;s a bit more complex and I don't want to recommend it if it's basically just adding complexity without much benefit (it would save you doing database stuff and expiry, not sure if that's worth it for you or not) Andrew On Thu, Dec 29, 2016 at 4:16 PM, Ken McDonald wrote: >

Re: How to send user specific data on Group().send() on Channels?

2017-01-02 Thread Andrew Godwin
r with one Group per user so that if a user has multiple windows open to the site they get all the messages. Andrew On Mon, Jan 2, 2017 at 12:59 PM, Utku Gültopu wrote: > In my application, I need run a piece of code (let's call it > prepare_and_send_data(user)) for every online user, e

Re: How to send user specific data on Group().send() on Channels?

2017-01-03 Thread Andrew Godwin
all online users" or "is user X online" because of the scaling tradeoffs in there. If you want those sorts of questions, you will indeed have to manage online status yourself. Andrew -- You received this message because you are subscribed to the Google Groups "Django users&quo

Re: Django-Channels strange slowdowns - how to profile?

2017-01-03 Thread Andrew Godwin
On Tue, Jan 3, 2017 at 9:55 AM, Deven Bhooshan wrote: > Hi Andrew, > Any plans of making some out of the box django-channels profiling > framework ? > It's not something I personally have time for at the moment - if someone wants to submit a proposal I'm sure we could g

Re: How to send user specific data on Group().send() on Channels?

2017-01-04 Thread Andrew Godwin
the client application just send something down the socket every 20 seconds to say it's alive and then handle it in the receive consumer instead. Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Re: Session key is empty after login on Django Channels development server

2017-01-08 Thread Andrew Godwin
Hi, Have you tried removing the "channels" package from INSTALLED_APPS and making sure it fails without that as well? Andrew On Sun, Jan 8, 2017 at 1:43 AM, Utku Gültopu wrote: > When I log a user in using django.contrib.auth.login function, session_key > is sometimes not se

Re: Sending messages to django channel group outside of consumers

2017-01-11 Thread Andrew Godwin
That code looks correct. What channel layer are you using? On Wed, Jan 11, 2017 at 2:55 PM, Gene wrote: > I'm trying to send messages to channels outside of consumers, as said in > documentation but can't get a result. > > For example, > in consumers.py I have: > > def channel_send(channel, data

Re: Sending messages to django channel group outside of consumers

2017-01-11 Thread Andrew Godwin
It will only work with a Redis channel layer - in memory does not transport things across processes. As long as everything being used has the same channel layer settings and talks to the same Redis, I don't see why it wouldn't work. Andrew On Wed, Jan 11, 2017 at 3:07 PM, Gene wrote:

Re: Sending messages to django channel group outside of consumers

2017-01-11 Thread Andrew Godwin
Yes, as long as the management command uses the same settings and talks to the same Redis server, it should all intercommunicate. If you can get it reproducible I can definitely help more. Andrew On Wed, Jan 11, 2017 at 3:14 PM, Gene wrote: > so, should it theoretically work in combinat

Re: Sending messages to django channel group outside of consumers

2017-01-11 Thread Andrew Godwin
Oh, disregard that, cross-checking with the django-channels IRC channel I see that it's the new message buffering behaviour going awry. You can track the status of the fix in https://github.com/django/channels/issues/481 On Wed, Jan 11, 2017 at 3:22 PM, Andrew Godwin wrote: > Yes, as

Re: Sending messages to django channel group outside of consumers

2017-01-11 Thread Andrew Godwin
Yup, I'm waiting on one more pull request to land and I'll issue a 1.0.2 release to address the issue. Andrew On Wed, Jan 11, 2017 at 4:10 PM, Gene wrote: > waiting for update in pip .. > > четверг, 12 января 2017 г., 3:09:50 UTC+3 пользователь Gene написал: > >> A

Re: list? queryet? joining together

2017-01-12 Thread Andrew Beales
Hi, just a couple of follow-up questions as having trouble following precisely. Can you re-state the exact queries you’re looking for? - Are you looking to check if there are tools of a given type available at a given time? - And whether a tool of a given type can be booked in a given time win

Re: Django-channels connecting 2 random people

2017-01-14 Thread Andrew Godwin
annel. I don't think groups would help too much here. Andrew On 14 Jan 2017 12:41, "Nikoleta Misheva" wrote: > Hello fellows, I started to go into channels and I saw the example for > multiplex chat but it is not excactly what I want and I will be happy if > someone can po

Re: Django-channels connecting 2 random people

2017-01-15 Thread Andrew Godwin
(you need to remove them from users and unpair them from their partner so they can be re-paired if you want) but that's the basic structure. Andrew On Sat, Jan 14, 2017 at 1:59 PM, Nikoleta Misheva wrote: > Would it be a good idea to add everyone that has an open connection t

Re: Channels - Unable to use redis as sharded cluster

2017-01-16 Thread Andrew Godwin
Hi Dadaso, You also opened this as a ticket on GitHub at https://github.com/django/channels/issues/485; I'll answer it there. Andrew On Mon, Jan 16, 2017 at 2:42 AM, Dadaso Zanzane < dadaso.zanz...@cuelogic.co.in> wrote: > Hi, > > I am using django channels for pr

Re: Experimenting with Channels: sending messages from Django shell doesn't work

2017-01-16 Thread Andrew Godwin
Hi Joshua, This was actually a bug that was fixed in 1.0.2 - were you on an older version? If not, I'd like to make sure the bug didn't somehow reappear! Andrew On Mon, Jan 16, 2017 at 10:00 AM, Joshua Gardner wrote: > I'm going to answer my own question: > > Appear

Re: Django Channels: send message on Group from worker process

2017-01-16 Thread Andrew Godwin
://channels.readthedocs.io/en/latest/delay.html Andrew On Mon, Jan 16, 2017 at 12:31 PM, Joren Inghelbrecht < inghelbrecht.jo...@gmail.com> wrote: > Hi everyone, > > > The idea is to run a background task on the worker.connect worker. While > executing the task, I would like to send its progress

Re: Django channels, running uwsgi and awsgi

2017-01-18 Thread Andrew Godwin
SGI server, and both can talk to the channel layer (redis in your example). Any Python code can send to a channel - WSGI workers, management commands, etc. You can just only act on messages on channels inside workers or async code you write yourself. Andrew -- You received this message be

Re: Django channels, running uwsgi and awsgi

2017-01-19 Thread Andrew Godwin
bSocket configuration you need inside a non-/ location block, and then just use that prefix for all of your sockets. 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

Re: Django-channels save reply channel to django model field?

2017-01-19 Thread Andrew Godwin
nformation down, then use a CharField(max_length=255), and put the name of the channel in that (which is usually reply_channel.name). You can then take the string name and pass it to channel to make it again like Channel(reply_channel_name). Hope that helps, Andrew On Thu, Jan 19, 2017 at 6:57 AM

Re: Django-channels and JSON-RPC

2017-01-19 Thread Andrew Godwin
er pattern very well. Andrew On Thu, Jan 19, 2017 at 7:34 AM, Fabien Millerand wrote: > Hi everyone, > > I am looking to implement a websocket server based on Django using > JSON-RPC protocol. > > I have been looking around for a pre-made solution without success. I am > al

Re: Django-channels save reply channel to django model field?

2017-01-19 Thread Andrew Godwin
Channels don't need to be deleted, they're just pointers. And yes, if you make a channel with the same name as a reply channel, it will function the same - all channels are, are strings put onto messages as a sort of header for routing and queuing purposes. Andrew On Thu, Jan 19, 201

Re: Django-channels and JSON-RPC

2017-01-20 Thread Andrew Godwin
On Fri, Jan 20, 2017 at 2:36 AM, Fabien Millerand wrote: > Thanks a lot for your answer Andrew. > > If you do end up implementing something, be sure to add it to the links page in the Channels docs (just submit a PR with the change) > On a side note, would you be related to Mike Go

Re: how handle high incoming data and sending throttled data to web sockets in django-channels

2019-01-14 Thread Andrew Godwin
ncer if you have messages coming in from multiple sources, or do your own work queue if it's a single source and you can't process them fast enough. Andrew On Mon, Jan 14, 2019 at 7:31 AM Sahil Mangotra < sahil.mango...@utradesolutions.com> wrote: > I am facing a problem in my

Re: Run Daphne as non-root on low ports

2019-05-02 Thread Andrew Godwin
also use a reverse proxy to terminate SSL, which is what Daphne is built assuming (the SSL support in there is because it comes for free with Twisted, rather than being specifically added). Andrew On Thu, May 2, 2019 at 6:32 AM BR wrote: > I'm running a simple Django/Channels website using Da

Re: Run Daphne as non-root on low ports

2019-05-02 Thread Andrew Godwin
In this case "reference server" merely refers to it being the place where new features and specs are implemented and tested first, rather than being the best production-capable one. I would say uvicorn is probably the best ASGI server out there right now for performance. Andrew On

Re: AutoField

2019-05-26 Thread Andrew C.
Probably because you have two AutoFields. You can’t have two in the same model. Set this to eid=models.AutoField(primary_key=True) This is because Django models automatically makes an id autofield primary key if nothing else is set as pk. On Sun, May 26, 2019 at 9:05 PM Bob Gailer wrote: > On M

Re: deploy to Heroku " collectstatic --noinput "

2019-05-27 Thread Andrew C.
Follow a tutorial. 1) Hide your secret key and everything secretive in an environment variable. Or use Django-environ 2) Try python manage.py check —deploy 3) Debug is set to True... it should not be True if you’re publishing (deploying) On Mon, May 27, 2019 at 3:46 PM omar ahmed wrote: > i can'

Re: How to use permissions on a CreateView class?

2019-05-30 Thread Andrew C.
Try clearing your browser history and info. Should also test in Incognito or Private browser so info is saved. I have a suspicion that your browser is saving login info and you’re just not realizing this. On Tue, May 28, 2019 at 5:54 PM Fellipe Henrique wrote: > Hi Jim, > > Tried that, as you ca

Re: How to use permissions on a CreateView class?

2019-05-30 Thread Andrew C.
Sorry. Info ISN’T saved on private browser On Thu, May 30, 2019 at 7:25 PM Andrew C. wrote: > Try clearing your browser history and info. Should also test in Incognito > or Private browser so info is saved. I have a suspicion that your browser > is saving login info and you’re

Re: Can we create a Rest Api in Django which can able to communicate with multiple databases(Relational, Non relational) dynamically. If yes please recommend me a way to do that

2019-06-23 Thread Andrew C.
There really isn’t any point in doing that. 1) You should just use one of the two. Django officially supports Postgres. 2) You’d want to keep your users all jumbled in one database. If you have a foreign key to the username field, and the db can’t find a specific user because it’s in the other db,

Re: Internal Ranking System Application

2019-06-24 Thread Andrew C.
Gotcha. I’ll try my best to explain what you could try. And if this looks sloppy, then I’ll make a public gist. So, firstly, let’s set some things straight. A database is a collection of tables. Models in Django represent one table with multiple columns. Tables do not need to have the same columns

Re: Internal Ranking System Application

2019-06-24 Thread Andrew C.
Np! https://docs.djangoproject.com/en/2.2/ref/models/fields/#floatfield Just refer to the docs. There’s FloatField and DecimalField for models. When you show the numbers in views, just use python to round the numbers. There are plenty of tutorials and SO (stackoverflow) questions that’ll help. Pe

Re: Django User model

2019-06-24 Thread Andrew C.
Like a profile? Try this: https://simpleisbetterthancomplex.com/tutorial/2016/11/23/how-to-add-user-profile-to-django-admin.html On Mon, Jun 24, 2019 at 9:13 AM AMOUSSOU Kenneth wrote: > Hi everyone, > > Is it possible to create different class that will extend the `User` base > class with diffe

<    2   3   4   5   6   7   8   9   10   >