Skip to content
Myr

Documentation on how to use external debuggers like eclipse/aptana

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sundar Raman · committed by Ron DuPlain · parent e2cb8d2 · Browse files · 1 file+34 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+34 added−2 removed

  • other:+34 added−2 removed

1 file+34 added−2 removed

modified:docs/quickstart.rst+34 added-2 removed
112 unmodified lines
113 :alt: screenshot of debugger in action114115.. admonition:: Working With Other Debuggers116117 Debuggers interfere with each other. If you are using another debugger118 (e.g. PyDev or IntelliJ), you may need to set ``app.debug = False``.117 Debuggers interfere with each other. 118 That said, you may still wish to use the debugger in a tool of your choice. 119 Flask provides the following options to manage the debug process:120121 * ``debug`` - whether to enable debug mode and catch exceptinos122 * ``use_debugger`` - whether to use the internal Flask debugger123 * ``use_reloader`` - whether to reload and fork the process on exception124125 ``debug`` must be True (i.e., exceptions must caught) in order for the 126 other two options to have any value.127128 If you're using Aptana/Eclipse for debugging you'll need to set both 129 ``use_debugger`` and ``use_reloader`` to False.130131 A possible useful pattern for configuration is to set the following in your 132 config.yaml (change the block as approriate for your application, of course)::133134 FLASK:135 DEBUG: True136 DEBUG_WITH_APTANA: True137138 Then in your application's entry-point (main.py), you could have something like::139140 if __name__ == "__main__":141 # To allow aptana to receive errors, set use_debugger=False142 app = create_app(config="config.yaml")143144 if app.debug: use_debugger = True145 try:146 # Disable Flask's debugger if external debugger is requested147 use_debugger = not(app.config.get('DEBUG_WITH_APTANA'))148 except:149 pass150 app.run(use_debugger=use_debugger, debug=app.debug, use_reloader=use_debugger, host='0.0.0.0')151152153Routing154-------155156Modern web applications have beautiful URLs. This helps people remember
699 unmodified lines