Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6128469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:37:50+00:00 2026-05-23T16:37:50+00:00

I am trying to get the channel api working. This is what I have

  • 0

I am trying to get the channel api working.
This is what I have so far:

in the view:

def channel_test(channel_token):
    tries = 1
    logging.info('starting channel_test')
    for attempt in range(tries):
        message = 'this is message number: ' + str(attempt)
        channel.send_message(channel_token, message)
        logging.info('just sent: ' + message)
        logging.info(channel_token)

def viewfunc():
    channel_token = channel.create_channel('aosasdf123')
    deferred.defer(channel_test, channel_token, _countdown=10)
    return render_template('Main/cycle.html', form=form, channel_token=channel_token)

and in my template:

<script type="text/javascript" charset="utf-8">
    function tell_user(message) {
        $('#CycleChannelMessages').append(message + '<br />');
    }

    function onOpened() {
        console.log('onOpened');
        var connected = true;
        tell_user('ready to take messages');
        tell_user('{{ channel_token }}');
    }
    function onMessage(msg_obj) {
        console.log('onMessage');
        tell_user('something');
        // tell_user(msg_obj.data);

    }
    function onError(obj) {
        console.log('onError');
    }
    function onClose(obj) {
        console.log('onClose');
    }

    var channel = new goog.appengine.Channel('{{ channel_token }}');
    var socket = channel.open();
    socket.onopen = onOpened;
    socket.onmessage = onMessage;
    socket.onerror = onError;
    socket.onclose = onClose;
</script>

But the only output I get is from onOpen:

ready to take messages
channel-1788270053-aosasdf123

And in the console I only see:

onOpened

So no other function has been run. The logs from the appengine launcher, clearly shows that the deferred function is being run and it is causing no errors or warnings.

Now what did I do wrong since nothing is showing up at the front-end.
This is on the dev-server BTW. I have not tried it in production yet.

Framework is Flask if that makes any difference.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:37:50+00:00Added an answer on May 23, 2026 at 4:37 pm

    You pass the client_id to send_message not the channel_token. So your code should be:

    channel.send_message('aosasdf123', message)
    

    You place the channel_token client-side for opening the channel, and keep the client_id secret on the server-side for transmitting messages to that client via the channel.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this string: tag:domain.com,2012-10-12:feed/channel/id/335 Im trying to get the last digits from this
I am trying to get nowelium / socket.io-titanium to work i have it working
I'm trying to get channel element from this document. <rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns=http://purl.org/rss/1.0/ xmlns:slash=http://purl.org/rss/1.0/modules/slash/ xmlns:taxo=http://purl.org/rss/1.0/modules/taxonomy/
I am trying to get some information about YouTube channel's from the YouTube API.
I'm trying to get contours from my frame and this is what I have
Trying to get this expression to work, can someone look at it and tell
I am trying to get histogram from my color (3-channel) image in OpenCV but
I'm trying to get IIS6 to work reliably with a WCF service I have
I'm trying to work with the Livestream API to see if a certain channel
I have been racking my brain for a few days trying to get a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.