Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to debug Bootstrap-Flask applications #13615

Open
8 of 10 tasks
PanderMusubi opened this issue Aug 24, 2020 · 1 comment
Open
8 of 10 tasks

How to debug Bootstrap-Flask applications #13615

PanderMusubi opened this issue Aug 24, 2020 · 1 comment

Comments

@PanderMusubi
Copy link
Contributor

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Spyder debugger does not stop on breakpoint.

What steps reproduce the problem?

  1. Install Bootstrap-Flask
  2. Open the Bootstrap-Flask example called app.py in Spyder
  3. Set a breakpoint on .e.g. https://github.com/greyli/bootstrap-flask/blob/master/examples/app.py#L93
  4. Run in debug mode
  5. Open browser for http://127.0.0.1:5000/form

What is the expected output? What do you see instead?

Spyder debugger should stop at breakpoint. Note that the web framework needs environment variables to get into debug mode before running app.py in debug mode:

export FLASK_ENV=development
export FLASK_DEBUG=True

Paste Traceback/Error Below (if applicable)

n/a

Versions

  • Spyder version: 4.1.4
  • Python version: 3.8.2
  • Qt version: 5.12.9
  • PyQt version: 5.12.3
  • Operating System name/version: Ubuntu 20.04

Dependencies

# Mandatory:
atomicwrites >=1.2.0           :  1.4.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.5.0 (OK)
diff_match_patch >=20181111    :  20200713 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.16.1 (OK)
jedi =0.17.1                   :  0.17.1 (OK)
keyring                        :  None (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  1.1.0 (OK)
parso =0.7.0                   :  0.7.0 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.2 (OK)
pygments >=2.0                 :  2.3.1 (OK)
pylint >=1.0                   :  2.5.3 (OK)
pyls >=0.34.0;<1.0.0           :  0.34.1 (OK)
qdarkstyle >=2.8               :  2.8.1 (OK)
qtawesome >=0.5.7              :  0.7.2 (OK)
qtconsole >=4.6.0              :  4.7.5 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
sphinx >=0.6.6                 :  3.1.2 (OK)
spyder_kernels >=1.9.2;<1.10.0 :  1.9.2 (OK)
watchdog                       :  None (OK)
xdg >=0.26                     :  0.26 (OK)
zmq >=17                       :  19.0.1 (OK)

# Optional:
cython >=0.21                  :  None (OK)
matplotlib >=2.0.0             :  None (OK)
numpy >=1.7                    :  1.17.4 (OK)
pandas >=0.13.1                :  None (OK)
scipy >=0.17.0                 :  None (OK)
sympy >=0.7.3                  :  None (OK)
@steff456
Copy link
Member

Hi @PanderMusubi,

Right now, we don't have an option to add environment variables for debugging in Spyder. However I was able to run the debugger in the example that you provided by FLASK_ENV=development FLASK_DEBUG=True FLASK_APP=path/to/app spyder. In this way you will have all the environment variables that you need in order to debug the app.

We will work for adding this option in Spyder 5,
Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants