Ask Your Question
1

debug for django-admin

asked 2021-08-10 02:39:56 -0500

skirando gravatar image

updated 2021-08-10 06:26:46 -0500

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

edit retag flag offensive close merge delete

Comments

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

Wingware Support gravatar image Wingware Support  ( 2021-08-10 06:27:01 -0500 )edit

dhango-admin makemigrations myadd

skirando gravatar image skirando  ( 2021-08-10 09:55:25 -0500 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2021-08-11 06:13:48 -0500

Chris Curvey gravatar image

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.

edit flag offensive delete link more

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 gravatar image Wingware Support  ( 2021-08-11 07:28:21 -0500 )edit
0

answered 2021-08-10 12:00:35 -0500

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2021-08-10 02:39:56 -0500

Seen: 111 times

Last updated: Aug 11