0

I have an issue regard a html-file changing through server-side. I'ill explain: I am trying to build a Queue Management System and I wish to display a queue on the client-side. It's should seems like that: enter image description here

But the problem is that I do not know how to change html through the server. I'm using python3 (aiohttp+asyncio) if it's important.

JuiceFV
  • 171
  • 11

1 Answers1

0

edit: This question was misunderstood by me, look a the comment of JuiceFV to get an appropiate answer.

A simple example of a server that serves a webpage is like this:

from aiohttp import web
routes = web.RouteTableDef()

@routes.get('/')
async def hello(request):
    return web.Response(text="<html><body><h2>Hello, world</h2></body></html>", content_type="text/html")

app = web.Application()
app.add_routes(routes)
web.run_app(app)

It yields Hello, world at the client side.

David
  • 2,926
  • 1
  • 27
  • 61
  • 1
    Thanks for your response! I meant a little bit different thing. For example, when an user gets his token, it (token) has to be seen each user of the application, from their own client. Also I used templates (rendering the using jinja2), therefore I need to change my index.html through server. I found a solution with jinja2 (https://jinja.palletsprojects.com/en/2.11.x/templates/) – JuiceFV Apr 12 '20 at 11:20