Skip to content
Demo of calling Javascript functions in a Python environment on Google App Engine.
Python JavaScript
Find file
New pull request
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



This is a quick demo of Javascript code being shared between server and client, using pyjon to evaluate Javascript in a Python environment with Django on Google App Engine.

Enter some numbers then click the relevant button to either evaluate it on the server or in your browser. The adding function is only defined once, in shared-functions.js, which is read and evaluated by the server, as well as being served to the browser.

Obviously this is massive overkill for adding two numbers(!), but the concept could be applied to more complex calculations, operations on objects, etc, such that common logic only needs to be defined once.

Something went wrong with that request. Please try again.