python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.65k stars 2.27k forks source link

Can't connect to a websocket (poetry only) #1443

Closed yshym closed 5 years ago

yshym commented 5 years ago

Issue

Application is a simple chat using django-channels and celery (just tried to substitude Pipenv with poetry for my old app). While managing my deps using Pipenv, everything is OK and i have no issues at all. But while using poetry with exactly same deps list, server can't find websocket via its route and get this error.

[06/Oct/2019 22:13:46] "GET /chat1/ HTTP/1.1" 200 8842
Not Found: /ws/chat/chat1/
[06/Oct/2019 22:13:47] "GET /ws/chat/chat1/ HTTP/1.1" 404 2607

Pipenv output:

HTTP GET /chat1/ 200 [0.07, 127.0.0.1:51086]
WebSocket HANDSHAKING /ws/chat/chat1/ [127.0.0.1:51090]
WebSocket CONNECT /ws/chat/chat1/ [127.0.0.1:51090]

Here is this app: https://github.com/fly1ngDream/channels-chat (After commit that start using poetry for deps management, sockets became broken). I had tried to use beta version of poetry, but it didn't help

Jamim commented 5 years ago

Hi @fly1ngDream,

I see that output formats are quite different, so I assume that in case of poetry you are running your application with runserver which knows nothing about the ASGI_APPLICATION setting in your config and in case of pipenv you are running it in some different way.

However, if you really need some help, please provide clear steps to reproduce the issue.

yshym commented 5 years ago

@Jamim yea, but i start server exactly the same way. Obviously, server can't recognize ASGI. To reproduce you should start server via runserver, start redis server (redis-server) and start celery worker (celery worker -A config -l info) in a django directory. Then create new chat room and try to connect to it.

Jamim commented 5 years ago

@fly1ngDream I've tried what you described with pipenv using code from https://github.com/fly1ngDream/channels-chat/commit/77ba32bc8e945526c02abbd7e4cb2b87497d11ab and it leads to the same results that you got with poetry.

/home/mim/.local/share/virtualenvs/channels-chat-CfSyx6Xc/bin/python /home/mim/projects/test/channels-chat/django/manage.py runserver 8000
Performing system checks...

Watching for file changes with StatReloader
System check identified no issues (0 silenced).
October 07, 2019 - 01:43:55
Django version 2.2.2, using settings 'config.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[07/Oct/2019 01:44:03] "GET /chat1/ HTTP/1.1" 200 7226
Not Found: /ws/chat/chat1/
[07/Oct/2019 01:44:03] "GET /ws/chat/chat1/ HTTP/1.1" 404 2607
Not Found: /favicon.ico
yshym commented 5 years ago

@Jamim Weird. Ill try it again later and give a comment

yshym commented 5 years ago

Recreated pipenv virtualenv and got same issue. Obviously, poetry is not the source of this issue

yshym commented 5 years ago

The issue was: i installed the django-channels dependency which has nothing in common with the channels one

github-actions[bot] commented 8 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.