Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channels compatibility #10

Open
namedots opened this issue Feb 25, 2017 · 13 comments
Open

Channels compatibility #10

namedots opened this issue Feb 25, 2017 · 13 comments

Comments

@namedots
Copy link

Should this project work with https://channels.readthedocs.io ?

In my attempts django-livereload-server doesn't inject livereload.js, and when doing so manually the refresh is sent out before ./manage runserver has finished restarting.

@tjwalch
Copy link
Owner

tjwalch commented Feb 26, 2017

No, it doesn't work with channels (yet). Unfortunately channels patches out the runserver command in an incompatible way. Probably not a huge fix if someone has the need and the time to fix it.

@fennecinspace
Copy link
Contributor

HELLO .... to make it work with channels .. do this

in you wsgi.py file :

  • import the variable application from your asgi.py file as asgi_application (you can choose any name)
  • change
    this -> application = get_wsgi_application()
    to -> application = asgi_application

@tjwalch
Copy link
Owner

tjwalch commented Oct 5, 2018

Have you tried it and it works? Because that wasn't the problematic thing, it had to do with runserver command.

@fennecinspace
Copy link
Contributor

@tjwalch for me the runserver command never works ... i always do runserver in a terminal an livereload on another

@tjwalch
Copy link
Owner

tjwalch commented Oct 5, 2018

Yes that's how you need to do it, it is two processes as stated in the instructions. But you need livereload-servers's patched runserver to get livereloads on python file changes. And this wasn't working with channels.

@fennecinspace
Copy link
Contributor

fennecinspace commented Oct 5, 2018

it's working normally ... in fact i stopped doing this hack all together, i just cloned the repo instead of using the pip install method and it's working just fine without any modifications....
it's not the app that's incompatible with channels
most people using channels don't know the proper way to set up a project

proof /
image

@tjwalch
Copy link
Owner

tjwalch commented Oct 5, 2018

If livereload-server was working properly the runserver command would issue a livereload request after start/restart. And it doesn't according to your printout.

@fennecinspace
Copy link
Contributor

fennecinspace commented Oct 5, 2018

@tjwalch

image

it's working without a problem

i tool the picture as soon as i started the server that's why you didn't see it

the issue that needs to be fixed isn't the server not starting issue ... it's working normally and i've been using it, the issue that needs to be fixed is to ignore web socket messages, because every time the server sends a message to the client .. the livereload app is reloading the client

PS:
when i used the pip install method i had to use the workaround mentioned above to get this to work, but when i cloned the repo and added the app manually to the project, it worked normally without having to apply the workaround .... that's why i opened an issue saying that you have to launch a new release

@tjwalch
Copy link
Owner

tjwalch commented Oct 6, 2018

You don't seem to understand how livereload-server is supposed to work and what's not working with channels. The problem isn't livereload command but runserver - but you show me livereload output.

  • I don't see the point in issuing a new release with the same code? You are free to submit a PR if you think you have improvements.

@fennecinspace
Copy link
Contributor

what is wrong with the runserver command ? i mean, everything is working properly for me ... i'm using channels 2

@tjwalch
Copy link
Owner

tjwalch commented Oct 10, 2018

Do you get livereload requests when python files are changed and devserver has restarted? According to your printouts you don't. Because the last line output on starting runserver would be LiveReload request emitted.

Reload on templates and static files work without livereload-server's runserver but not reload on python files.

@fennecinspace
Copy link
Contributor

when i change css js py files the browser reloads automatically ..

@tjwalch
Copy link
Owner

tjwalch commented Oct 10, 2018

OK. If you submit a PR I will look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants