Hi,
I am trying to implement the OpenTok WebRTC APIs, as described in the HelloWorld tutorial, but am running into issues when trying to create sessions. What is the best way to do this? I am running Python on Google App Engine and have installed the Python OpenTokSDK.
Right now I am trying to create the session in my Python script with the following code, and pass the session ID, but it is not returning anything:
import OpenTokSDK
jinja_environment = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))
api_key = '99999999' # Replace with your OpenTok API key.
api_secret = 'lasjflksjadfjasldjfasjkldfjklsdf' # Replace with your OpenTok API secret.
session_address = '8.8.8.8' # Replace with the representative URL of your session.
opentok_sdk = OpenTokSDK.OpenTokSDK(api_key, api_secret)
session = opentok_sdk.create_session(session_address)
class MainPage(webapp2.RequestHandler):
def get(self):
template = jinja_environment.get_template('test.html')
self.response.out.write(template.render({ 'var1': session }))
app = webapp2.WSGIApplication([('/test', MainPage)],
debug=True)
Thanks for your help,
Geoff