Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

502
Views
FasiAPI comm : Fetch python callback in js and access javascript from FastAPI

I tried to code with FastAPI docs, but no way to access js and python callback

Is it possible to use python callback in js and access javascript in FastAPI?

from flask import Flask
from flask import render_template
import jyserver.Flask as jsf

app = Flask(__name__)

@jsf.use(app)
class App:
    def __init__(self):
        self.count = 0

    def increment(self):
        self.count += 1
        self.js.document.getElementById('count').innerHTML = self.count

@app.route('/')
def index():
    return App.render(render_template('index.html'))

if __name__ == '__main__':
    app.run()
<!DOCTYPE html>
<html>
    <head>
        <title>Change DOM</title>
    </head>
    <body>
        <p id="count">0</p>
        <button onclick="server.increment()">Increment</button>
    </body>
</html>

I want use FastAPI like this...
(jyserver Examples)

reference1 : https://github.com/sohan-py/ChangeDOM
reference2 : https://dev.to/ftrias/access-js-dom-from-flask-app-using-jyserver-23h9

I tried to use async and POST, GET method, but I can't find solutions..

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!