python - Flask 404 on Dreamhost -


I am using flask on Dreamhost. I (mostly) followed the instructions posted here. I can set up pages successfully and send the URL directly to those pages and so on.

Now I want to be able to set up a 404 page. I set an error handler via an app. ARP handler is the only problem that if I go to a page on which the URL is not set then it just returns a standard Apache 500 error page. Is this because Dreamhost is Apache setup? The public (static) folder is at the top level, how can you fix it?

You can try to create the file "missing.html" at the top level.

Source:

Edit: To deal with an error from the flask to the page, you do this:

  Flask imports from render_template @ App.errorhandler (404) def page_not_found (e): return render_template ('404.html'), 404  

View:

I think you are getting There are 500 errors because the flask / python is crashing. Do you have debugging? How is your routing setup?


Comments

Popular posts from this blog

eclipse plugin - Run java code error: Workspace is closed -

ios - How do I use CFArrayRef in Swift? -

scala - Play Framework - how to bind form to a session field -