Internal Server Error 500 is an annoying error that will probably make you want to smash your computer.
because this error caused too many sources, (I, often encountered the background py file error, including some very incredible format errors)
so looking for a long time on the Internet finally found a good solution
use python pyamf client connect to the server, only quote us this error:
pyamf.remoting.RemotingError: HTTP Error 500: INTERNAL SERVER ERROR
If you just look at this mistake, you’ll get confused. You have to make the error report more specific.
Think about it, there are two ways to make the error location, one is to change pyAMf source code, one is to change the source code of Django, let Django directly print out 500 error messages.
This is done with the second idea.
Django 500 source: python2.7/site – packages/django/core/handlers/base. Py
The source code is as follows, the middle section is added by me, so that the detailed error can be displayed:
def handle_uncaught_exception(self, request, resolver, Exc_info):
“”
Processing for any otherwise uncaught exceptions (those that will
generate HTTP 500 responses). Can be overridden by subclasses who want
customised 500 handling
Be *very* careful when overriding this because the error could be
caused by anything, so assuming something like the database is always
available would be an error.
"""
from django.conf import settings
if settings.DEBUG_PROPAGATE_EXCEPTIONS:
raise
logger.error('Internal Server Error: %s', request.path,
exc_info=exc_info,
extra={
'status_code': 500,
'request': request
}
)
#============= Code start ========== by chang
print "---------- HTTP 500 Error Msg ---------- "
print exc_info
import traceback
print traceback.format_exc()
print "---------------------------------------- "
#============= Code end =========
if settings.DEBUG:
from django.views import debug
return debug.technical_500_response(request, *exc_info)
# If Http500 handler is not installed, re-raise last exception
if resolver.urlconf_module is None:
raise exc_info[1], None, exc_info[2]
# Return an HttpResponse that displays a friendly error message.
callback, param_dict = resolver.resolve500()
return callback(request, **param_dict)
Read More:
- Tomcat Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors
- [How to Solve] java.lang.IllegalArgumentException: Request header is too large
- JSON parse error: Can not deserialize instance of java.lang.String out of START_OBJECT token
- Python3: Str.format Keyerror Solution for incoming parameter error
- Creating test database for alias ‘postgres’… Got an error creating the test database: permission
- Template Render Error Solution (Hexo blog theme, GIT upload)
- No match for ‘operator =’ both ends of the equal sign do not match
- How to Fix Webpack run error webpack dev server
- Axios request failed, get the status code and error information, how to encapsulate the function dealing with the public error code
- Nginx: How to Use Error_Page
- target is multiclass but average=’binary’. please choose another average setting.
- TypeError: unsupported format string passed to numpy.ndarray.__format__
- Java handles special characters in URL
- XAMPP Error: Apache shutdown unexpectedly.This may be due to a blocked port, missing dependencies…
- Installation and error report of tensorflow
- How to Solve Error: could not list the contents of folder
- [How to Fix]Type error: must use keyword argument for key function
- Type error: must use keyword argument for key function
- The method println(boolean) in the type PrintStream is not applicable for the arguments (void) Error
- ValueError: Input 0 of node import/save/Assign was passed float from import/beta1_power:0 incompatib