Redirigir una url antigua a una nueva con micro-marco de frasco
from flask import Flask, redirect, request
app = Flask(__name__)
redirect_urls = {
'http://example.com/old/': 'http://example.com/new/',
...
}
def redirect_url():
return redirect(redirect_urls[request.url], 301)
for url in redirect_urls:
app.add_url_rule(url, url, redirect_url)
SAMER SAEID