How to use subdomains in flask?

im trying to use subdomain in flask but i get an error

Well, you found a glitch.

Did you expect to see an app here? You might need to log in to get access. If something went wrong, you can check out our Help Center if you need a hand.

@app.route(‘/’, subdomain=‘test’)
def practice():
return “test”
now the service works but when i go to test.domain.glitch.me i get a warning from my anti-virus and from chrome and when i skip them alll i get that error
i tried on localhost too and it doesnt work so i dont know how to set them up the tutorials i saw say something about ect/hosts but i still dont understand i thought all i needed to do was add subdomain in the route and it would work

This might help you: Subdomain in Flask | Python - GeeksforGeeks

so i just need to make a file called hosts and add 127.0.0.1 and my subdomain?

there’s more than the route you need

:white_check_mark: subdomain resolves to server
:x: server has certificate for subdomain
:x: server can deliver request to app
:white_check_mark: app can handle request

unfortunately those middle two would be up to glitch; they’re not under your control.