Closed DJManas closed 2 years ago
I had played a little with ptvsd and dap-python.el. Had found the correct command for and/not and had altered the file on line 205, where I had changed
(if program (shell-quote-argument program) "")
to
(if (and program (not (string-equal module "flask"))) (shell-quote-argument program) "")
Then I had started the debugger (spc d d-d), it "worked", the command was:
python -m ptvsd --wait --host localhost --port 56814 -m flask run --no-debugger --no-reload
but I have hunch, that it doesn't send the enviromental variables into the command, because the result is.
Missing launch request or attach request before configuration done request.
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
Usage: python -m flask run [OPTIONS]
Try 'python -m flask run --help' for help.
Error: Failed to find Flask application or factory in module 'app'. Use 'FLASK_APP=app:name' to specify one.
I had tried to rewrite the launch json into * DAP Template like this
(dap-register-debug-template "Flask"
(list :type "python"
:env '(
(:FLASK_APP "app/app.py")
(:FLASK_ENV "development"))
:request "launch"
:args "run --no-debugger --no-reload"
:module "flask"
:jinja t
:name "Flask"))
But I am getting this error when launching it shell-quote-argument: Wrong type argument: sequencep, 114
I will try to debug it tomorrow. I have a hunch it has something to do with my if statement.
For flask with debugpy it should be repaired using pull request #576
Missing launch request or attach request before configuration done request.
Error: Failed to find Flask application or factory in module 'app'. Use 'FLASK_APP=app:name' to specify one.
The problem is that flask cannot find the derrictory and even if you specify it, it does not work and gives an error. As soon as you fall into the derritory with the app.py file, everything starts fine.
Hello,
I have problem with debugging of flask app inside my emacs. I don't have vanilla, but using Spacemacs or Doom one, both are the same. System Mac OS Emacs version GNU Emacs 27.2 (build 1, x86_64-apple-darwin21.3.0, Carbon Version 165 AppKit 2113.3) of 2022-02-20 Python version 3.9.10
When I go into the project directory, where I have launch.json, generated by VSCode, the template gets shown, when I M-X and use dap-debug, I see the template there, no problem, but when I launch it, it won't work.
The template looks like
I have setup python in Doom like this (Doom can use debugpy).
When I launch the debugger inside my project using M-X dap-debug and select the Kotelna configuration I get this.
In * Messages buffer I can see this
I had tried the discord and was pointed here by @yyoncho. Also he pointed me to this link that there was something similar with the ptvsd (I got almost the same with ptvsd under spacemacs so I wanted to alter it a bit, but I am new to emacs and lisp). I might try to debug the process, but I will have to get used to emacs and lisp debugging process.
Thanks, Regards, Petr Sourek