How to link a wildcard domain to flask?
I am trying to make a website for people to create profiles, with the url for a site to be .domain.com instead of domain.com/username, and so I set a wildcard CNAME record on namecheap, but when I try visiting a page, it just says "Run The Repl", unless I specifically linked that subdomain before.
I don't want to link every single useable subdomain, but when I type *.domain.com into the link domain menu it takes much longer than a just putting a subdomain.
Try something like this (replace
app with your
@app.route("/", subdomain="<username>") # now the subdomain will be passed into the parameter 'username' def profile(username): return "Hello " + username + "!"
Then you can enter
iWaroz.domain.com. The output would be