Re: channels and https

2018-12-28 Thread Andrew Godwin
You should use an ASGI server (uvicorn/daphne) with an SSL-terminating server (e.g. nginx) in front of it and proxying to it. Django-sslserver is a WSGI-based server and so can't support WebSockets. Andrew On Tue, Dec 25, 2018 at 4:44 PM wrote: > How can I use channels with https at developmen

Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread Andrew Godwin
This may be related to https://github.com/django/asgiref/issues/251 - what version of asgiref are you running? Andrew On Tue, Apr 6, 2021, at 9:43 AM, kradem wrote: > > 500 Internal Server Error > > Exception inside application. > > Daphne > > This error raises every time a file from static f

Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread Andrew Godwin
ef<4,>=3.3.2, but you have asgiref 3.3.1 which is incompatible."), but > static files are served well. > > I tried with the very last version 3.3.3 (-e > git+https://github.com/django/asgiref.git#egg=asgiref), but problem hasn't > been fixed that way. > >

Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread Andrew Godwin
ot;django 3.2 requires >> asgiref<4,>=3.3.2, but you have asgiref 3.3.1 which is incompatible."), but >> static files are served well. >> >> I tried with the very last version 3.3.3 (-e >> git+https://github.com/django/asgiref.git#egg=asgiref), but problem

Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread Andrew Godwin
t; > HTTP GET /static/css/style.css 500 [0.35, 127.0.0.1:37982] > HTTP GET /static/js/jquery-2.2.4.min.js 500 [0.35, 127.0.0.1:37988] > > Dana utorak, 6. travnja 2021. u 18:09:33 UTC+2 korisnik Andrew Godwin napisao > je: >> __ >> Aha, glad to hear it! My apologies that

Re: Daphne raises Internal Server Error when accessing static files from development server

2021-04-06 Thread Andrew Godwin
500 Internal Server Error > Transfer-Encoding: chunked > Content-Type: text/html; charset=utf-8 > > Dana utorak, 6. travnja 2021. u 18:26:34 UTC+2 korisnik Andrew Godwin napisao > je: >> __ >> The tracebacks are there somewhere, you might have to look at the raw HTTP >

Re: register_converter doesn't work with ASGI

2021-06-20 Thread Andrew Godwin
Ah yes, that's because the URL parsing/conversion all happens in the main (async, in ASGI mode) thread - and because to_python is a a synchronous function interface, there is literally nothing you can do to make it work. The only real way of fixing this would be for Django to patch the URL conv

Re: Async Help Needed

2021-08-12 Thread Andrew Godwin
The example you presented should Just Work - that error generally only occurs if you return an un-awaited coroutine, which if you're just returning a response, should be impossible. What version of Python and Django are you running? Andrew On Thu, Aug 12, 2021, at 11:03 AM, Steven Mapes wrote:

Re: Channels: launching a custom co-routine from SyncConsumer

2019-08-15 Thread Andrew Godwin
SyncConsumer isn't async - it runs inside a separate synchronous thread. You'll need to get the event loop from the other thread and use call_soon_threadsafe instead! Andrew On Wed, Aug 14, 2019 at 6:59 PM Dan Merillat wrote: > > I have an application that's 99% using the ORM and database work

Re: Channels 2 using asyncio run_in_executor

2019-10-18 Thread Andrew Godwin
It should be fine, but you will need to be careful - there's a lot of side-effects with run_in_executor you should be aware of like the way exceptions propagate (Django won't handle them right for you) and the possibility of deadlock. Andrew On Fri, Oct 18, 2019 at 11:27 AM BR wrote: > Should I

Re: Channels, daphne, and asgiref, oh my!

2020-02-21 Thread Andrew Godwin
Hi Larry, Your problem is the Python version - 3.5 is somewhat old (but most importantly, was still a very rough release for asyncio) and isn't supported by any current release of asgiref/channels for that reason. If you are able to upgrade that, I very much recommend it. Andrew On Sat, Feb 22,

<    1   2   3   4