[Python] Calling a Python web app from an HTML page [closed]

Discussão em 'Python' iniciado por Stack, Novembro 22, 2024.

  1. Stack

    Stack Membro Participativo

    I am aware that this is a weird way to do things, but I can't come up with any other options.

    Context: I need to run a Python web app (made with the gradio framework) on a hosted Apache web server. In any other situation, I'd just set the Apache config to redirect to the web app's port, but I don't have sudo permissions. I can't access the Apache config files even in read-only. As far as I can work out, the entry point defined by Apache is the index.html file in the site directory.

    Separate from that, I have a gradio app that I want to host on the same server. By default, it serves on port 7860 (which I can't access from outside the server.) The documentation for Gradio all assumes that the web app will be hosted on HuggingFace, so it's not helpful for this situation.

    Is there a simple(ish) way to 'call' the Python app from my HTML entry point? It's alright if the web app restarts for every user, and I'm willing to rewrite the UI components if there's a Python library that would make this simpler.

    Continue reading...

Compartilhe esta Página