Created
November 17, 2011 07:37
-
-
Save anonymous/1372608 to your computer and use it in GitHub Desktop.
Double meta refresh for flask
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta name="robots" content="noindex" /> | |
<meta http-equiv="refresh" content="0; url={{ url }}" /> | |
</head> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This would most likely be SQLAlchemy table or something | |
urls = { '1': 'http://siteA.com', '2': 'http://siteB.com' } | |
@bp.route("/redirect/<int:url_id>/"): | |
def redirect(url_id): | |
url = url_for('meta', url_id=url_id) | |
return render_template("meta.html", url=url) | |
@bp.route("/meta/<int:url_id>/") | |
def meta(url_id): | |
url = URLS[url_id] | |
return render_template("meta.html", url=url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment