Closed tfarina closed 9 years ago
Run the app in debug mode (app.debug = True
) to see the exception/traceback.
Also, during local development/testing the builtin dev server is pretty useful. No need for a full-blown webserver. It just makes things more complex.
That is one of the problems. When running the app with python directly it does work and shows '/add' correctly. When I move to the nginx + uwsgi it shows this 500 error.
Configure Python's logging to enable Flask's traceback output in production. The following example configures it to print to stderr, which should get captured by uWSGI. Please post the full traceback.
import logging
handler = logging.StreamHandler()
handler.setLevel(logging.ERROR)
app.logger.addHandler(handler)
I didn't get anything on terminal with that.
When I change it to {{ url_for('index') }} it returns '/microblog/'. For anything else it returns 500 error.
But I need {{ url_for('add_entry') }} to return '/microblog/add'
There's not enough information here to continue. Try configuring logging to log to a file instead, if uWSGI isn't picking up stderr.
OK @davidism, thanks for your support!
For future reference I was able to get some backtrace following http://librelist.com/browser/flask/2012/1/27/catching-exceptions-from-flask/#e3f303db052ce2bdae0801269b51d55d
I had to add --catch-exceptions to uwsgi command line and app.config['PROPAGATE_EXCEPTIONS'] = True to the application.
i got error in flask applications
Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
how to rectify the error?
@chaitanya425 Both your comments are completely useless. You posted a super generic error message and nothing else. What do you expect us or anyone else to do there?
@ThiefMaster i need solution
Seriously, what do you expect? You didn't even post any code. Anyway, this is the wrong place. Go to Stack Overflow or our Discord/IRC channel, and share your code. Debug mode also help in seeing what's actually failing.
@ThiefMaster cool bro i need help in error (500 Internal Server Error) do you have solution please tell me otherwise. i know stack overflow ok .
In Flaskr example, I'm getting the following for url_for('add_entry')
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
This is running behind uwsgi with emperor mode. Logs are absent and do not show the real problem and I'm unable to diagnose.