[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Eric, debugging a flask application
From:       Detlev Offenbach <detlev () die-offenbachs ! de>
Date:       2019-05-25 11:00:33
Message-ID: 1839843.ruRAWZ0Rh8 () neptun
[Download RAW message or body]

Hello Guðjón,

would you be willing to create a little Howto/Tutorial for the eric web-site? 
If so, please send me the HTML for the main part and I'll wrap it in the eric 
web site layout.

Regards,
Detlev

Am Samstag, 25. Mai 2019, 08:01:19 CEST schrieb Guðjón Guðjónsson:
> Hi Detlev
> 
> Thanks for the answer
> On Fri, May 24, 2019 at 8:02 PM Detlev Offenbach
> 
> <detlev@die-offenbachs.de> wrote:
> > Hi,
> > 
> > is flask executed in a separate process? I don't know how the flask web
> > server is started. Maybe you have to run the flask web server main script
> > within the debugger.
> 
> When I tried to make a small example of the problem, it just works.
> 
> Introduction to Flask can be found here:
> http://flask.pocoo.org/
> 
> A simple example:
> 
> hello.py
> """
> from flask import Flask
> app = Flask(__name__)
> 
> @app.route("/")
> def hello():
>     return "Hello World!"
> """
> 
> $ pip install Flask
> $ FLASK_APP=hello.py flask run
>  * Running on http://localhost:5000/
> 
> But for debugging I got a hint from
> https://wingware.com/doc/howtos/flask
> 
> and the script is changed to:
> 
> hello.py
> """
> from flask import Flask
> app = Flask(__name__)
> 
> @app.route("/")
> def hello():
>     retstr = "Hello World!"
>     return retstr
> 
> 
> if __name__ == "__main__":
>     # Preferably check if Eric debugger is active before switching off
> Flasks internal debugger
>     app.debug = False # Switch off Flask internal debugger.
>     app.run()
> """
> 
> This works fine in the Eric debugger
> 
> 
> But for some reason this doesn't work in the program I want to debug.
> It doesn't stop at my
> breakpoints. But when I moved the debug to a parameter in the run
> command it works.
> 
> if __name__ == "__main__":
>     #app.debug = False
>     app.run(debug=False)
> 
> Now it works perfectly :)
> 
> Regards
> Gudjon
> _______________________________________________
> PyQt mailing list    PyQt@riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt

-- 
Detlev Offenbach
detlev@die-offenbachs.de


_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic