First time here? Check out the FAQ!
1

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

skirando's avatar
21
skirando
asked 2021-08-10 02:39:56 -0600
Wingware Support's avatar
4k
Wingware Support
updated 2021-08-10 06:26:46 -0600
edit flag offensive 0 remove flag close merge delete

Comments

What is the command line you use outside of Wing to run that command?

Wingware Support's avatar Wingware Support (2021-08-10 06:27:01 -0600) edit

dhango-admin makemigrations myadd

skirando's avatar skirando (2021-08-10 09:55:25 -0600) edit
add a comment see more comments

2 Answers

1

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.

Chris Curvey's avatar
216
Chris Curvey
answered 2021-08-11 06:13:48 -0600
edit flag offensive 0 remove flag delete link

Comments

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.

Wingware Support's avatar Wingware Support (2021-08-11 07:28:21 -0600) edit
add a comment see more comments
0

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-...

Wingware Support's avatar
4k
Wingware Support
answered 2021-08-10 12:00:35 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer