Jump to content

Recommended Posts

Posted

I don't understand what happened. On Thursday, I tested my site and everything was working. I was able to log into the Django admin site (www.klickfu.com/admin) and do everything. On Saturday, my colleague said that he couldn't get in. I checked and he was correct. All references to the admin site result in an exception which tries to display a 500.shtml page (which I didn't make, so it turns into a 404 error). None of the files changed, so I don't understand why it broke and I have no way to see the actual exception. The site error log simply states that the WSGI script threw an exception.

 

The only admin link that does work is www.klickfu.com/admin/logout. It seems to work and logs me out, and if I try to log in from the subsequent screen, I get the log in prompt. But as soon as I enter my credentials and click Login, I get the 500 error.

 

Any suggestions on how to figure this out?

Posted
Please refer to the Solving Internal Server Errors wiki article for information about 500 errors.

 

Thanks for the reference, but none of it seems to be applicable to this situation.

1) Server load is less than 4

2) If don't have control over the permissions for the django folders, but they were correct two days ago and pieces of it work, so I assume they are still correct.

3) I am not running any other processes on my site.

 

What I really need is a way to get the actual exception thrown to be displayed in the error log or on the screen.

Guest Geoff
Posted

Put this in your dispatch.wsgi:

 

try:
    #Old dispatch.wsgi code goes here (make sure it's tabbed in!).
    
except: 
    import traceback
    
    trace = traceback.format_exc()
    
    def application(environ, start_response):
    
        status = '500 Internal Server Error'
        output = trace
                        
        response_headers = [('Content-type', 'text/plain'),
                        ('Content-Length', str(len(output)))]
        start_response(status, response_headers)
                
        return [output]

Posted
Put this in your dispatch.wsgi:

 

try:
    #Old dispatch.wsgi code goes here (make sure it's tabbed in!).
    
except: 
    import traceback
    
    trace = traceback.format_exc()
    
    def application(environ, start_response):
    
        status = '500 Internal Server Error'
        output = trace
                        
        response_headers = [('Content-type', 'text/plain'),
                        ('Content-Length', str(len(output)))]
        start_response(status, response_headers)
                
        return [output]

 

 

Thanks, this helped a lot!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...