Giter Site home page Giter Site logo

Comments (5)

synw avatar synw commented on August 23, 2024

Hi. I rewrote the docs to make it more clear. It was a bit messy yes, specially the client side handlers: this should be better now. Thanks for mentioning it.

Please check out the client side handlers part and let me know if anything is unclear or wrong anymore

from django-instant.

tboulogne avatar tboulogne commented on August 23, 2024

hello,

My template directory is like this

templates
 I_ instant
    I_ handlers
       I- default.js

Into default.js i get :

if (channel === "public") {
    console.log(message)
 }

But nothing into console.log. I enable watch option on instant admin, i could see messages.

Any idea please ?

from django-instant.

synw avatar synw commented on August 23, 2024

The default public channel name is settings.SITE_SLUG_public, so if your SITE_SLUG value in settings is my_site, your channel will be named mysite_public.
You can check in the debug console for the connected channels. Note: it is better to use declarative channels: it is more explicit and you can even control where it should connect from. In settings, and the default public channel will be deprecated in the future

INSTANT_ENABLE_PUBLIC_CHANNEL = False  # do not use the default chan
# declare my chan
INSTANT_PUBLIC_CHANNELS = [
    ['public_chan'],
]

Then use a templates/instant/handlers/public_chan.js handler, or just stick with the default handler

I plan to work on better error messages btw,

{Edit]:

I enable watch option on instant admin, i could see messages.

Check the channel name in the json console message to make sure it is ok

{Edit 2]

nothing into console.log

Did you set the INSTANT_DEBUG setting to True? It should show you if you are connected on a channel or not. Did you include the client template?

from django-instant.

tboulogne avatar tboulogne commented on August 23, 2024

my bad again !
In my different tests to make it work i remove the client.

Thanks i'm on the way now ;).

from django-instant.

synw avatar synw commented on August 23, 2024

That's it! Enjoy

from django-instant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.