{{extend 'layout.html'}} {{block sectionclass}}debug{{end}}

{{=T("web2py online debugger")}}

{{if filename:}}

{{=T("Interaction at %s line %s") % (filename, lineno)}}

{{if exception:}}

{{=T("Exception %s", exception['title'])}}

{{pass}}
{{=T("Code listing")}}
{{if lines:}}
{{=CODE('\n'.join([x[1] for x in sorted(lines.items(),key=lambda x: x[0])]),
                        language='python', link=None, counter=min(lines.keys()), 
                        highlight_line=lineno, context_lines=10)}}
{{pass}}
  • {{=T("Your application will be blocked until you click an action button (next, step, continue, etc.)")}}
  • {{=T("You can inspect variables using the console below")}}

{{=T("Interactive console")}}

{{elif request.env.get('wsgi_multiprocess') or not request.env.get('wsgi_multithread'):}}

{{=T("Unsupported webserver working mode: %s", request.env.get('server_software', ''))}}

  • {{=T("WARNING:")}} {{=T("This debugger may not work properly if you don't have a threaded webserver or you're using multiple daemon processes.")}}
  • {{=T("In development, use the default Rocket webserver that is currently supported by this debugger.")}}
  • {{=T("On production, you'll have to configure your webserver to use one process and multiple threads to use this debugger.")}}
{{#=BEAUTIFY(request.env)}} {{else:}}

{{=T("No Interaction yet")}}

  • {{=T("You need to set up and reach a")}} {{=A(T("breakpoint"), _href=URL('breakpoints'))}} {{=T('to use the debugger!')}}
  • {{=T('To emulate a breakpoint programatically, write:')}} {{=CODE("from gluon.debug import dbg\n" "dbg.set_trace() # stop here!\n", counter=None)}}
  • {{=T('Please')}} {{=A(T("refresh"), _href=URL('interact'))}} {{=T('this page to see if a breakpoint was hit and debug interaction is required.')}}
{{pass}}