문제

I want to Web2py to just return the error screen/stack-trace... i don't want this ticketing system in place. how can I turn it off?

도움이 되었습니까?

해결책

You cannot. If you are logged in as administrator and you click on the ticket number, it will open a window with the stack-trace. You can use routes_onerror in routes.py to display a different error page to your user and hide the ticket number if you do not wish to expose it.

다른 팁

I hide tickets from end users in our Web2py production environment by doing the following:

1) In the model (db.py) I test to see if I am in the production environment and if so, I add a variable called hide_ticket to the user's request:

# The is_production variable is read from an environment variable earlier.
if settings.is_production:
    request.hide_ticket = True

2) Then modify gluon/main.py to this:

    if request.hide_ticket:
        http_response = \
            HTTP(500, '<html><body><h1>Request Failed</body></h1></html><!--- IE Needs this' + ('x' * 512) + '--->' )

    else:
        http_response = \
            HTTP(500, rwthread.routes.error_message_ticket %
                 dict(ticket=ticket),
                 web2py_error='ticket %s' % ticket)

Instead of this:

 http_response = \
                HTTP(500, rwthread.routes.error_message_ticket %
                     dict(ticket=ticket),
                     web2py_error='ticket %s' % ticket)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top