Skip to content

Instantly share code, notes, and snippets.

@codenoid
Last active April 23, 2020 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codenoid/63710baf5b653a2ea9284ccc7eab2cc7 to your computer and use it in GitHub Desktop.
Save codenoid/63710baf5b653a2ea9284ccc7eab2cc7 to your computer and use it in GitHub Desktop.
Flask handle 404 with rickroll
@app.errorhandler(404)
def handle404(error):
html = "<center>"
html += "<br><br><br>"
html += '<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ?controls=0&autoplay=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
html += "<br>"
html += "nothing to do here :p"
html += "</center>"
return html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment