debug for django-admin
I would like to run a django-admin command in debug mode.I don't know how to do it. I tried with terminal but I'm not in debug. Thank's for clues
I would like to run a django-admin command in debug mode.I don't know how to do it. I tried with terminal but I'm not in debug. Thank's for clues
I think you can run the following as an equivalent to 'django-admin makemigrations myadd' on the command line:
/path1/to/python /path2/to/django-admin.py makemigrations myadd
Of course you have to replace both /path1/to and /path2/to with the actual paths to those files. For Python you can see its path in the Python Shell in Wing by typing this:
import sys
sys.executable
Note that if you try this on the command line outside of Wing you only need the full path to Python if you're running outside of an activated environment.
Assuming that does work, you can open django-admin.py in Wing, right click on the editor to select Properties, and then enter the run args under the Debug/Execute tab:
makemigrations myadd
Then you can start debug for that file in Wing.
Note that you can also create and debug named entry points if you have several different command lines you want to debug. These are described in https://wingware.com/doc/debug/named-...
I have not tried it with makemigrations
, but if I am trying to set a breakpoint in the django code, I've found that adding import wingdbstub
at the bottom of my project urls.py
seems to be a nice way of getting the debugger started.
Yes, the steps for this are described in https://wingware.com/doc/debug/debugg... -- it may still be easier to just launch django-admin.py from Wing, though, as described in the other answer.
To enter a block of code:
Comments
What is the command line you use outside of Wing to run that command?
dhango-admin makemigrations myadd