Question

Using wild card sub domains, but allow flask to control the output

Basically, after setting up my server following this and now I have connected my domain, for example, example.com and also the wild card sub domain *.example.com and now I want flask to handle the sub domain, so if someone went to dev.example.com it would be able to have a different page from test.example.com.

@app.route("/")
def hello_world():
    return render_template("index.html")

@app.route("/", subdomain="dev")
def dev_world():
    return "This is the Development Area"

that is basically the current code, however, going to any subdomain, always links back to the example.com/ not the subdomain directory. thank you for any help!


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer