Re: Need help: webrtc signalling with django app

2017-08-23 Thread Andrew Godwin
My impression was that RTC signalling was not specified or defined so apps could do it how they wish - so you could use normal AJAX, or WebSockets, etc. Channels doesn't have RTC support as, as far as I could tell, the specified parts are all browser-to-browser. Andrew On Wed, Aug 23, 2017

Re: Setting up a "update" async with channels

2017-08-28 Thread Andrew Godwin
toring the background process (note: you cannot run the process from inside a consumer, consumers should be nonblocking), for both updates and when it exits Andrew On Mon, Aug 28, 2017 at 3:53 AM, Samuel Muiruri wrote: > Hi, > I want to use django-channels to show progress report of a back

Re: [Channels] Worker Live Reload

2017-08-29 Thread Andrew Godwin
There is no live reload on runworker at the moment - this problem will be mostly fixed with Channels 2.0, though, when we eliminate the need for runworker. Until then, it's not an easy thing to add, but if you're feeling ambitious, it's the sort of thing I would happily take a pat

Re: get json sent to channels in view

2017-08-30 Thread Andrew Godwin
You want to look for incoming data on the "websocket.receive" channel, which will call you once per message you send down with the right data. That's "websocket.connect", which happens after the socket opens but before data is sent down it. Andrew On Wed, Aug 30, 2017 at

Re: Channels - Forward messages from a third party async source.

2017-09-01 Thread Andrew Godwin
ng it easier to write worker processes like this, but that's not something that's ready in the short term. Andrew On Fri, Sep 1, 2017 at 3:56 AM, Roger Gammans wrote: > Hi all, > > I'm trying to build a system with a Django frontend which displays live > information from o

Re: Processing data sent by sockets in django-channels

2017-09-04 Thread Andrew Godwin
Hi, I don't keep track of stack overflow so I don't know if anybody else would answer stuff there. Secondly, I replied to a very similar question you asked on this list last week - is this the same problem as that? Andrew On Mon, Sep 4, 2017 at 1:45 AM, Samuel Muiruri wrote: >

Re: Django channels

2017-09-07 Thread Andrew Godwin
Yes, you'd need to do this manually - the databinding in Channels right now is very barebones and doesn't handle initial state versus change management. I'd love to eventually get a full event-sourcing solution done, but I have a lot of things I would like to do! Andrew On Thu, S

Re: Django channels

2017-09-08 Thread Andrew Godwin
Not yet - feel free to file one and tag/label it as a feature request, but it's unlikely to be done soon as there's a lot of foundational work to be done at the moment :) Andrew On Fri, Sep 8, 2017 at 3:21 AM, wrote: > Thanks a lot. Is there any Github issue? Maybe if I have tim

FROM ONLY in Postgres back-end

2017-09-12 Thread Andrew Hankinson
gging. Do I modify QuerySet to try and implement my own custom lookup code? Or will I need to dig into the SQL compiler to do this? Or is this whole thing a waste of my time? Or maybe there's a magic hook somewhere I'm missing that will let me inject what I need. I'm hoping f

Re: FROM ONLY in Postgres back-end

2017-09-13 Thread Andrew Hankinson
inal Message- > From: django...@googlegroups.com [mailto: > django...@googlegroups.com ] On Behalf Of Christian > Ledermann > Sent: Wednesday, September 13, 2017 12:00 PM > To: django...@googlegroups.com > Subject: Re: FROM ONLY in Postgres back-end > > On 12 Septemb

Re: How to authenticate a user in websocket connection in django channels when using token authentication

2017-09-15 Thread Andrew Godwin
You'll have to write your own authentication code that runs in `connect` and puts a user into the channel session - there's nothing built in that will really help you past that I'm afraid. Andrew On Thu, Sep 14, 2017 at 6:35 PM, Robin Lery wrote: > I am using a frontend fram

Re: Channels architecture for chat application and subscriptions

2017-09-17 Thread Andrew Godwin
ution for a full-featured chat, but you're going to have to write a lot of additional logic around it. I have on my backlog a proper event-sourcing solution that would solve many of these, but I am focused on channels 2.0 first and the changes that will bring. Andrew On Sun, Sep 17, 2017 at 8:1

Re: Channels architecture for chat application and subscriptions

2017-09-20 Thread Andrew Godwin
Yes, you can do as you suggest, but you're also right that it will be slow to send. Groups are more efficient in theory, but right now their send implementation is also a for loop (though it's a little bit tighter) so not sure how drastic the difference will be. Andrew On Sun, Sep 17,

Re: ASGI alongside mod_wsgi behind an Nginx proxy

2017-09-23 Thread Andrew Godwin
Hi there, This is a current bug with the root path setting - see https://github.com/django/daphne/issues/125. Until it's fixed, I'd recommend just coding all URLs as absolute and making nginx pass them through as such. Andrew On Fri, Sep 22, 2017 at 2:13 PM, Sean F wrote: > Hi

Re: Channels: Using `allowed_hosts_only` with `WebsocketDemultiplexer`

2017-09-25 Thread Andrew Godwin
but that's not going to be useable for a little while. Andrew On Mon, Sep 25, 2017 at 11:20 AM, Michael Huang wrote: > Hi there. I couldn't figure out how to use the allowed_hosts_only > decorator with the connect method of WebsocketDemulitplexer. I ended up > copying and pas

Re: Django Channels: best way to launch multiple workers

2017-10-10 Thread Andrew Godwin
I don't have enough hard data to give a recommendation, unfortunately. Andrew On Mon, Oct 9, 2017 at 7:14 PM, Piet van Leeuwen wrote: > On a server is there a recommendation for how many workers to have running? > > With Gunicorn we would run... > > def max_workers(): &g

Re: Django Channels: Comparison to ipyparallel

2017-10-12 Thread Andrew Godwin
event streams with synchronous code than this, which seems to be a bit more celery like? Andrew On Wed, Oct 11, 2017 at 11:39 PM, Виталик Абеткин wrote: > Hi, Django folks, > > I wonder how Django channels would compare to using https://github.com/ > ipython/ipyparallel for delayed syn

django-improved-user v1.0a1

2017-10-12 Thread Andrew Pinkham
ful to the community. I would therefore really appreciate any feedback! Thanks 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-improved-user v1.0a1

2017-10-12 Thread Andrew Pinkham
Forgot to add links. >_< https://github.com/jambonsw/django-improved-user https://pypi.org/project/django-improved-user/1.0a1/ http://django-improved-user.readthedocs.io/en/latest/?badge=latest Andrew http://jambonsw.com http://django-unleashed.com -- You received this message becau

Re: Django Websockets / Several Users on the Website

2017-10-12 Thread Andrew Godwin
m channel with the reply_channel of the socket, have a worker listen on that channel, and when it is done send information back to the reply_channel. Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: django-improved-user v1.0a1

2017-10-13 Thread Andrew Pinkham
template and cannot currently commit to another project. Hope this helps, 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 emails fro

drop image in div and add path to db

2020-03-12 Thread Andrew Fry
Hi all... newbie here. I have jQuery drag 'n drop working for a web app but cannot seem to figure out how to get the path of the dropped image uploaded to my db.sqlite3 database. What do I need to provide to get some help. Thanks in advance. -Andrew -- You received this message becaus

Re: Django channel and gunicorn

2020-03-19 Thread Andrew C.
Install uvicorn. Easy integration with gunicorn. There’s a good article about how to setup your Djsngo 3.0 async websocket app online too now. On Thu, Mar 19, 2020 at 3:32 AM Suraj Thapa FC wrote: > You can't use gunicorn with django channels... > Use Daphne or uwsgi etc > > On Wed, 18 Mar 2020,

Re: write a new app

2020-03-19 Thread Andrew C.
If you want to avoid web frontend, then stick to mobile app development. DRF as someone else mentioned helps. I recommend front end development because they have guidelines and make thing easier to implement (iOS is much much easier). You can’t make a usable app without doing both frontend and back

Re: AWS API or EC2 for chat?

2020-03-24 Thread Andrew C.
The only hint I can freely provide is to use celery tasks. They let you do taskname.delay(pk_user1, for_chat_pk). You can look online for an article with the url dev.to to setup your asgi.py file. That’s all I can freely give out, though. Good luck! On Tue, Mar 24, 2020 at 10:40 PM Motaz Hejaze

Re: AWS API or EC2 for chat?

2020-03-24 Thread Andrew C.
Hejaze wrote: > That was unexpected , i thaught about using python module socketio > > On Wed, 25 Mar 2020, 5:08 am Andrew C., wrote: > >> The only hint I can freely provide is to use celery tasks. They let you >> do taskname.delay(pk_user1, for_chat_pk). You can look onlin

Re: Online money transfer

2020-03-27 Thread Andrew C.
Stripe is the best imo On Fri, Mar 27, 2020 at 12:49 PM Motaz Hejaze wrote: > Any ideas guys > > On Fri, 27 Mar 2020, 3:07 pm Motaz Hejaze, wrote: > >> Hi friends , >> What is the best and easiest way to implement money transfer from visa to >> visa and from visa to bank account ?? >> And how t

Re: How to Setup DjangoRestFrameWork with Mongo DB

2020-03-28 Thread Andrew C.
I highly recommend not using MongoDB. Sure, they can plaster a banner saying “Google supports us” but many industry leaders have tried and failed using it. It can’t store data that easily once you grow, making it unlikely for usage in the future for employment by any startup or corporation and for

Re: In pycharm errror

2020-04-10 Thread Andrew Fetting
Sounds like you are on file too deep. manage.py should be in {project name}\manage.py, not {project name}\{project name}\manage.py. Hope that helps. On Fri, Apr 10, 2020 at 5:23 PM Jatin Agrawal wrote: > Can you please post an image of your directory structure? Maybe then I or > someone else can

Re: 502 Bad Gateway nginx/1.14.0 (Ubuntu)

2020-04-11 Thread Andrew C.
What’s the HTTP status code? Does the nginx page even show anything? Try: sudo systemctl stop nginx && sudo systemctl disable nginx && sudo systemctl enable nginx && sudo systemctl start nginx This command could also be in the wrong order... it’s been awhile. It could be a symbolic link error. I

Re: i want to change database sqllite to mysql but show error

2020-04-12 Thread Andrew Fetting
Have you tried pip3 install mysqlclient On Sun, Apr 12, 2020, 7:36 AM Arun Sharma wrote: > python manage.py runserver > > > > Watching for file changes with StatReloader > Exception in thread django-main-thread: > Traceback (most recent call last): > File > "C:\Users\Arunkumar\PycharmProjects\

Re: Channels/Daphne offloading SSL Certs to AWS ELB fails to establish socket

2020-04-21 Thread Andrew C.
I’m about to create a PR (or not, not sure) with an AWS ALB setup for cookiecutter django. The gist of it really is that there’s an article my msaizar that has a good nginx configuration setup. Remove traefik and add nginx. Your target group in AWS should have all machines registered on port 80 and

Re: please suggest me, related to technologies that I should use for facebook like chat

2015-08-10 Thread Andrew Farrell
This is orthogonal to Django, but I would take a look at TornadIO and https://github.com/MrJoes/tornadio/tree/master/examples/chatroom On Mon, Aug 10, 2015 at 8:56 AM, JAI PRAKASH SINGH < jaiprakashsingh...@gmail.com> wrote: > Hello all, > > > I want to to make a facebook like chat applicatio

Re: How to use Django 1.8.2 with Python 2.7?

2015-08-11 Thread Andrew Farrell
viron['DJANGO_SETTINGS_MODULE']` -- Andrew On Tue, Aug 11, 2015 at 11:56 AM, wrote: > I'm studying the Django Project tutorial > <https://docs.djangoproject.com/en/1.8/intro/tutorial01/> using Python > 2.7 (because that's my department's current standard) and Django

Re: Learning Python and Django and should I?? (I have a year of 10 or so hours a week)

2015-08-14 Thread Andrew Farrell
One tool for debugging that I would actually use isn't actually a debugger although ipdb is great . If you decide to go with python/django, I would strongly consider using the book Test Driven Web Development with Python

Re: What I need to know to be a Django full stack developer?

2015-09-04 Thread Andrew Farrell
For the devopsy things you mention, the second best way to learn that is to spin up a $5 VPS and work through tutorials like how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-14-04

Re: Hi

2015-10-03 Thread Andrew Farrell
If you already have python 3.5 installed globally, then you can do ``` $ which python3.5 /usr/bin/python3.5 $ virtualenv -p /usr/bin/python3.5 ~/trying35 ``` to create a virtualenv with python3.5 in it. If you use the conda package manager, you can do ``` c

Re: Using Django and R in a production environment?

2015-10-07 Thread Andrew Farrell
One option is to use the conda package manager (you can get that here ) to create an environment with `conda create --name django+r django=1.8` activate it with `source activate django+r` And then install R packages with something like `conda install --channe

Password protect content

2015-11-02 Thread Andrew S
Hello, I have a folder full of HTML files that will reside on a subdomain. I would like to password protect these with user accounts etc. Can this be easily completed with Django? is there any packages that already do this? Andrew -- You received this message because you are subscribed

Re: Apache2, mod_wsgi and django setup

2015-11-12 Thread Andrew Farrell
Others on here should jump in with help with your other questions but I think you should find the answers to your first and third by running `ps aux | grep apache` and looking at the first column. You might also find it enlightening to run `ps auxf | grep apache -B 2`. On Thu, Nov 12, 2015 at 4:34

Re: matching query does not exist.

2015-11-19 Thread Andrew Farrell
return redirect('signup') request.POST.get('shift_id') returns None. When that gets passed to mealShifts.objects.get(pk=shift_id), it raises the error. You can confirm that by inserting the line import pdb;pdb.set_trace() before that line and run `print(request.POST.ge

Re: am new to django and at a dead end or so i think

2015-12-03 Thread Andrew Farrell
en running it with C:\Users\LENOVO> python testsyntax.py I'm running on OSx. I don't know why the syntax should fail in one case and succeed in the other, but it is worth a try. -- Andrew Farrell On Thu, Dec 3, 2015 at 7:56 AM, Emmanuel Olodun wrote: > Microsoft Window

Re: Need a Tutorial

2015-12-05 Thread Andrew Farrell
Python tutorials: The tutorial I first learned python from was Think Python , which is free to download. That was several years ago and better things have been written since. I am a fan of the approach that Learn Python the Hard Way

Re: am new to django and at a dead end or so i think

2015-12-07 Thread Andrew Farrell
of the duplicated app. Note that if you accidentally leave that `import pdb; pdb.set_trace()` in there, it will cause your app to wait forever. You can use The Platinum Searcher <https://github.com/monochromegane/the_platinum_searcher> to check for all examples of a string in a codebase. --

Re: Migrate django project to eclipse/pydev ide

2015-12-22 Thread Andrew Farrell
Could you also tell us: 1) Why you need to switch to Eclipse specifically rather than PyCharm , SublimeText , or (the one I use) Atom ? 2) What error Eclipse is s

Re: Using API's efficiently in the framework

2015-12-27 Thread Andrew Farrell
It looks like you several words. To pre-empt a question you might be asking, if you are trying to call out to an API during the request-response cycle, you can find that the request to your app times out. To solve this, people often use a task-runner such as celery (https://github.com/celery/celer

Scanning for Wifi

2015-12-28 Thread Andrew Stringfield
Hello all, I saw a really cool feature that D-link wireless cameras have. First you physically hook up the camera to the LAN and then access the camera via web interface. While on the web interface you can scan for your wireless network and connect the camera, wirelessly, to your networ

Running Python3 code and placing results in a view

2016-01-03 Thread Andrew Stringfield
Hello all, I am interested in running the code of: #!/usr/bin/python3 from wifi import Cell, Scheme ssid = [cell.ssid for cell in Cell.all('wlan0')] print(ssids) with a view in Django and the results displayed in a drop down list. Here is the information about the WIfi module that I am us

Re: Setting up Django

2016-01-16 Thread Andrew Farrell
you want class Choice(models.Model): Note the capitalization of Model. By convention, class names in python should be capitalized. On Sat, Jan 16, 2016 at 5:56 PM, ofeyofey wrote: > hi, > > I see the error there was dateTimeField and corrected that but now I > get > > pi@raspberrypi ~/Djan

Re: How to learn Django stepwise Effectively

2016-01-20 Thread Andrew Pinkham
off the top of my head. I hope that helps! 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

Re: Diving into Django 2016

2016-02-09 Thread Andrew Farrell
<http://www.obeythetestinggoat.com/pages/book.html> by Harry Percival - Django Unleashed <https://www.amazon.com/Django-Unleashed-Andrew-Pinkham/dp/0321985079> by Andrew Pinkham *Databases* When you are first learning, you should stick with the SQLite database that comes pre-configured out of the bo

Re: How to update a live / deployed Django project?

2016-02-10 Thread Andrew Farrell
ation to deploy a django site (with postgres, gunicorn, and nginx) on a local virtual machine and then VPS as well as one way of writing automated tests for the configuration. If you have feedback on the tutorial or suggestions on how to improve the learner experience, please let me know. cheers, An

Re: Learning Django resources

2016-02-17 Thread Andrew Pinkham
Hi Robert, You may be interested in my response to this question in another thread: https://groups.google.com/d/msg/django-users/-iTZB7K1QI4/TTVXd9Y6EwAJ Hope that helps, Andrew -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

Re: Alternative Amazon S3?

2016-02-25 Thread Andrew Pinkham
Orange are possibilities, but I wouldn't advise it; if you do decide on that route, I recommend looking into CDN services for distribution at that point. Why does S3 not suit your purposes? Without knowing your goals, it's a little hard to advise. Andrew -- You received this message b

HStoreField - Field value is an object usually, but a string when in shell

2016-03-22 Thread Andrew Grossman
I'm working with a model that has an HStoreField field named "options". The options field on a model instance is a dictionary when running the webserver, but is a string when in the shell. This isn't simply a matter of it being coerced by the shell; the model's attribute dictionary and *dir()*

DjangoCon US 2016

2016-03-23 Thread Andrew Pinkham
om/djangocon>. Hope to see you in Philly! 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 t

Should I use Django's builtin control panel for user facing purposes?

2016-04-08 Thread Andrew Chiw
I'm making a Django website for a company, where the company's employees will validate clients that sign up. I'm thinking that the clients should have a mini control panel where they can change their own information only, while the company's employees have their own control panel where they can

I might need a different control panel... or do I?

2016-04-08 Thread Andrew Chiw
I'm making a Django site for a company, and the way I envision it working is this: The company's employees can manage and validate clients who sign up on the site as well as link them to other services. Once the clients login, they have their own little control panel where they can change their

In a new Model with a OneToOne(User) relationship, how to get the username?

2016-04-10 Thread Andrew Chiw
class Client(UserenaBaseProfile): def __str__(self): return self.name user = models.OneToOneField(User, unique=True, verbose_name=_('Django Login'), related_name='client') name = mo

Re: Redirect Loops and 404 with Django Channels and runserver command

2018-06-09 Thread Andrew Godwin
Hi Justin, I'm going to reply to you on the ticket you opened at https://github.com/django/channels/issues/1075 with the same question :) Andrew On Fri, Jun 8, 2018 at 7:56 AM Justin Lee wrote: > I was just trying to integrate channels into an existing django/DRF > project and

Re: Chatbot using Django Channels. Persist a python object in a scope?

2018-06-10 Thread Andrew Godwin
ication. You should think about this even for WebSocket; what happens if the user's socket reconnects? Does the state machine reset? If not, you need to store state somewhere externally from the socket handling code. Andrew Andrew On Sat, Jun 9, 2018 at 5:05 AM Rithwik Cherian wrote: >

Re: Django Channels 2.0 websocket crashing & blocking while using aiohttp

2018-06-17 Thread Andrew Godwin
on it for messages forever. Not sure why the crashing Channels websocket takes down the client one, but maybe they are both made to crash by some third, external, force? Andrew On Sun, Jun 17, 2018 at 11:33 AM Nathan Bluvol wrote: > I am using Django 2.0.5, Python 3.6.2, Django Channels 2.1.1, ai

Re: Django Channels 2.0 - How to init and persist/communicate with only one instance of background worker for every channel_layer.send?

2018-06-21 Thread Andrew Godwin
The worker server tries to keep one application instance open per incoming channel name, but that's no guarantee. It will always make a new instance for different channel names. What kind of behaviour are you expecting? Andrew On Tue, Jun 19, 2018 at 6:45 AM itsnate_b wrote: > I

Re: Django Channels 2.0 - How to init and persist/communicate with only one instance of background worker for every channel_layer.send?

2018-06-23 Thread Andrew Godwin
(see here: https://github.com/django/channels/blob/master/channels/worker.py), it really should be returning the same instance. I recommend you poke around in there and do some debugging to figure out what's going on. Andrew On Fri, Jun 22, 2018 at 9:46 AM itsnate_b wrote: > I am only usin

Re: Channels 2.0 close code and http response status

2018-06-23 Thread Andrew Godwin
e changed - you're always going to see an aborted WebSocket connection code instead. If you want to provide more detail to the user, you can instead accept the socket, letting the handshake finish, and then close it immediately with a custom WebSocket close code (you can do all of that inside conn

Re: Channels 2.0 close code and http response status

2018-06-24 Thread Andrew Godwin
I'm not quite sure - WebSockets do have browser differences. You could also try adding a delay between the accept and the close to see if that changes how they handle it. Andrew On Sun, 24 Jun 2018, 06:02 Kirill Tyushchakov, wrote: > Hi, Andrew! Thanks a lot for your response. > I

Re: Channels 2.0, How can I configure the channels 2.0 to use with the default django's views

2018-06-24 Thread Andrew Godwin
I'm not quite sure what you mean - Channels will still serve Django views as well unless you override HTTP serving as well as WebSocket, and even then, you can follow the URLRouter docs to keep it working fine: http://channels.readthedocs.io/en/latest/topics/routing.html#urlrouter Andrew O

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

2018-06-25 Thread Andrew Godwin
I mean, Channels isn't going to be some magical solution for that. A/V streaming still requires someone to sit down and write protocol code and a lot of real-time processing, and ultimately that's a lot more work than a WebSocket library. Andrew On Mon, Jun 25, 2018 at 10:49 AM wr

Re: django template rendering performance

2018-07-09 Thread Andrew Paulsen
No, Django renders the templates. Masoud, if you suspect there are negative difference between 2.7 and 3.5, please try to make a minimal app showing off the problem so the devs can fix it. On 2018-07-10 09:11, mottaz hejaze wrote: > i dont think so . rendering templates , though rendering templa

Re: ERROR - server - Error trying to receive messages: name 'txredisapi' is not defined

2018-07-13 Thread Andrew Godwin
What version of Channels are you using? It looks like you're trying to use Channels 1 without Twisted redis support installed - did you try installing the package it's asking for? Andrew On Thu, Jul 12, 2018 at 4:22 AM Hank Chu wrote: > 2018-07-12 17:35:08,070 - INFO - worker -

Re: [django-channels client wrapper] specifying no reconnection attempts

2018-07-15 Thread Andrew Godwin
can call to stop reconnection attempts when you get a good close event, maybe? Andrew On Sat, Jul 14, 2018 at 5:31 AM bit bouncer wrote: > Basically, I don't want the websocket to automatically attempt > reconnections after it has been closed by the server. > > I've

Re: Django Channels: long running async function and where to save ORM object

2018-07-16 Thread Andrew Godwin
andom orphaned tasks launched from web processes - there's no provision in the server to track that task and clean up after it. Instead, I'd recommend running those kinds of tasks in a separate process. Andrew On Sun, Jul 15, 2018 at 2:03 AM Sebastian Haase wrote: > Hi, > I'

Re: Django Channels: long running async function and where to save ORM object

2018-07-18 Thread Andrew Godwin
You can use async inside if you want, it's your choice. You will always have to run the separate process, though, yes. That's just a cleaner way of doing background tasks. Andrew On Mon, Jul 16, 2018 at 11:20 AM Sebastian Haase wrote: > Thanks for the reply. Should I still u

Re: [Channels] How to write tests with database access?

2018-07-22 Thread Andrew Godwin
best pattern for this is probably to send something back when you've finished processing and await receiving that, then you should guarantee that the work has been finished before your test continues. Andrew On Thu, Jul 19, 2018 at 8:18 AM Neraste wrote: > Hello Django users, > >

Re: How to check if server is running in ASGI or in WSGI mode?

2018-07-22 Thread Andrew Godwin
Where do you want to detect this? There's no official way of knowing, because you're meant to detect based on features/what gets called. Andrew On Thu, Jul 19, 2018 at 2:12 PM Rafis Ganeev wrote: > We are running same django project in WSGI mode for handling HTTP requests >

Re: Channels/Redis fault tolerance with Twemproxy?

2018-07-22 Thread Andrew Godwin
I'm afraid I've never used Twemproxy, so I can't really comment on it, but if you don't care about data loss, it's probably fine? Andrew On Fri, Jul 20, 2018 at 3:30 PM Filbert wrote: > Going to have 10 or more EC2 instances running Channels 2.0. I really > don&

Re: Channels/Redis fault tolerance with Twemproxy?

2018-07-22 Thread Andrew Godwin
I don't think redis-cluster supports BLPOP properly still so I don't think you can use it. Andrew On Sun, Jul 22, 2018 at 12:46 PM Filbert wrote: > And just to be clear as to my options, using Channels 2.0 I can use Redis > cluster if I have to to get failover and fault to

Re: Connecting to remote host like Twitch to monitor chat using websockets

2018-07-24 Thread Andrew Godwin
Hi Dave, It depends on what the protocol for the chat room is, but Channels is more for hosting websocket-based applications than consuming them. I suspect you would be better off looking at websocket client libraries, if the chat socket is even accessible. Andrew On Mon, Jul 23, 2018 at 4:45

Re: User Authenticated in Gunicorn and Daphne

2018-07-27 Thread Andrew Godwin
You can configure Nginx to route to different backends based on path - put your Nginx proxy_pass settings inside a "location" block. You can find examples on Stack Overflow - for example: https://stackoverflow.com/questions/13399252/nginx-reverse-proxy-to-multiple-backends Andrew On T

Re: Problem with sending django channels event from models

2018-07-27 Thread Andrew Godwin
You need to post the full traceback, not just the last section. I suspect what you are doing is calling model methods directly in an async function, but I can't confirm that without a full traceback. Andrew On Thu, Jul 26, 2018 at 1:10 PM luan fonceca wrote: > Hello, i'm trying t

Re: Problem with sending django channels event from models

2018-07-31 Thread Andrew Godwin
Yes, you can't just call "group_send" without awaiting it, or you'll get those warnings. You need async_to_sync, I'm afraid. Otherwise, you're not actually waiting for the group_send function to finish and you'll start getting some unreliable test results. Andr

Re: Channels/Redis fault tolerance with Twemproxy?

2018-08-02 Thread Andrew Godwin
could help are welcome, though. Andrew On Wed, Aug 1, 2018 at 1:22 PM Filbert wrote: > Well in digging through posts I see Sentinel may be an option, does that > mean if my CHANNEL_LAYER would have a single host entry? > > On Wednesday, August 1, 2018 at 9:42:39 AM UTC-4, Filbert wro

Re: Channels/Redis fault tolerance with Twemproxy?

2018-08-02 Thread Andrew Godwin
Yup, any sort of TCP-level proxy with failover will work for this sort of thing, but you'll likely see some errors whenever you failover as Channels loses its blocking connection that it's using to wait for messages - as always, please test a failover before you rely on it! Andrew On

Re: Channels/Redis fault tolerance with Twemproxy?

2018-08-05 Thread Andrew Godwin
Channels 1 and its Redis bindings have different behaviours to 2, so this might be improved there (but I can't guarantee it). Andrew On Sun, Aug 5, 2018 at 11:48 AM Filbert wrote: > Wow, I thought I had this working using haproxy in front of > redis-sentinel. haproxy fails over

Multi Tenancy

2018-08-09 Thread Andrew Fam
Hi all, I have a saas solution currently sitting in 1 instance using a postgres db. Due to recent expansions, I need to keep the data in the country of which it came from. e.g Malaysia or Philippines will have a database of their own. In addition, some companies are asking for on - prem version

Re: Multi Tenancy

2018-08-09 Thread Andrew Fam
10/08/2018 11:45 AM, Andrew Fam wrote: > > Hi all, I have a saas solution currently sitting in 1 instance using a > postgres db. > Due to recent expansions, I need to keep the data in the country of which > it came from. e.g Malaysia or Philippines will have a database of the

Re: Channels thread count is increasing

2018-09-17 Thread Andrew Godwin
There's a reasonably large threadpool that sync_to_async uses (I think it defaults to number of CPU cores * 5), so you're probably just seeing that. It should stop growing at some point. Andrew On Sat, Sep 15, 2018 at 4:02 PM erkin kabataş wrote: > Hi All, > > I am new t

Re: django ORM with asyncio

2018-09-18 Thread Andrew Godwin
The project to make the ORM truly async is a tough one and yet to be started. Andrew On Tue, Sep 18, 2018 at 5:55 AM luke lukes wrote: > I'm looking for something that can allow the usage of the Django ORM with > asyncio (with PostgreSQL). > > As of now I found only aiopg <ht

Re: Deploying Django app with Channels on Linux Hosting

2018-10-03 Thread Andrew Godwin
Hi there - it sounds like your host does not support websockets. You should check with them for more. Andrew On Wed, 3 Oct 2018 at 23:43, Manjunath wrote: > Hi all, > I have developed a simple app using django channels. > > I would like to deploy it on a linux hosting provider

Re: Channels: rejecting web socket connections with a custom close code

2018-10-06 Thread Andrew Godwin
spec at https://asgi.readthedocs.io/en/latest/specs/www.html#websocket but somewhat obliquely; I’ll try to make it a bit clearer. Andrew On Wed, 3 Oct 2018 at 13:23, Matt F wrote: > Hello all, > > I have a question about the process of accepting/rejecting web socket > connections

Re: [channels] 2.1.4 - Removing Javascript library entirely

2018-10-21 Thread Andrew Godwin
That's about right - you should ship and maintain the file yourself now. Andrew On Sun, 21 Oct 2018, 09:04 kradem, wrote: > Hi everyone! > > The subject is related to > https://github.com/django/channels/commit/2a9d764ad03927581aa2bfcadccc3e953949cb98 > > > It was ver

Re: generate username and password

2018-10-22 Thread Andrew Pinkham
rd. https://docs.djangoproject.com/en/2.1/topics/auth/customizing/#django.contrib.auth.models.BaseUserManager Andrew https://jambonsw.com <https://jambonsw.com/> https://django-unleashed.com <https://django-unleashed.com/> -- You received this message because you are subscribed to the Google

Re: Need help with CDN on Django App using heroku

2018-10-22 Thread Andrew Pinkham
https://devcenter.heroku.com/articles/django-assets http://whitenoise.evans.io/en/stable/django.html -- 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

Re: Creating seperate unique ids within the same table

2018-10-22 Thread Andrew Pinkham
On Oct 22, 2018, at 12:29, Matthew Pava wrote: > I am curious why you think it is anti-practice to expose primary keys for > user-visible purposes. > My URLs all have the PK to the object in them, and any advanced user would be > able to “reverse engineer” a URL if they guess the PK of an object

Re: Need help with CDN on Django App using heroku

2018-10-22 Thread Andrew Pinkham
https://www.caktusgroup.com/blog/2014/11/10/Using-Amazon-S3-to-store-your-Django-sites-static-and-media-files/ Andrew https://jambonsw.com https://django-unleashed.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group an

Re: Trigger actions independently of url request

2018-10-22 Thread Andrew Pinkham
ttps://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-events.html If it is tightly coupled and Celery is too powerful for your needs, you could use an AWS Lambda (or Azure Function, etc) to send a request to your Django API on a regular basis. Andrew https://jambonsw.com https://django-unlea

Re: Channels: about max message size

2018-10-23 Thread Andrew Godwin
ot cutting you off with a request timeout or something. Andrew On Tue, Oct 23, 2018 at 5:38 AM Chris wrote: > I use Channels & websockets for my webapp's "export data" functionality, > since it can take a long time to generate the file (more than 30 seconds). >

Re: Channels -- a question about how ProtocolTypeRouter works

2018-10-26 Thread Andrew Godwin
Hi Drew, The return value is indeed an object, but if you look closely at it you'll see it defines a __call__ method - meaning that when it's called as an ASGI application, it then returns a further object to act inside the scope. Andrew On Fri, Oct 26, 2018 at 2:55 PM Zhiyu/Drew

Re: Channels -- a question about how ProtocolTypeRouter works

2018-10-26 Thread Andrew Godwin
I would instead think of the object that ends up there as a factory that makes the final objects that end up per-scope. It's slightly confusing, I will grant you, but in Python anything can make a new class instance, not just a class constructor, which is what's happening here. Andr

Re: How to subclass AsyncHttpConsumer for a GET request?

2018-10-29 Thread Andrew Godwin
Yup, that's the right way - subclass the async consumer class and then write a handle method. You have to do your own post/get distinctions, like in a Django view, but with the scope rather than the request. Andrew On Mon, Oct 29, 2018 at 4:37 PM Zhiyu/Drew Li wrote: > Not sure if thi

<    4   5   6   7   8   9   10   >