Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

503
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda