First time here? Check out the FAQ!
1

Set an environment variable and debug a standard Python file within a Django project

Hello trying to debug a python file (test file) within a django project. I need to set up an environment variable before launching the debugger. I created a selected launch configuration. in the tab environment run arguments is blank. In environment I selected add to inherited environment i add the environment variable.
Build command is use project_setting.

This configuration still launch a python manage.py command.£ What is wrong?

piscvau's avatar
486
piscvau
asked 2023-06-04 16:26:53 -0500
Wingware Support's avatar
4k
Wingware Support
updated 2023-06-05 08:00:11 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

In Django projects created with New Project the main entry point is set to manage.py, which I think is why it's launching that. You have to bring up the test file in the editor and use Debug Current File from the Debug menu, or you can create a Named Entry Point that pairs the test file with the launch configuration you have created and then launch that.

Note that using Debug Current File will only work if you set the launch configuration as the one to use in the File Properties for your test file, but if I'm understanding your question correctly then you have already one that and it's just a question of telling Wing to run the test file and not the main entry point.

Also, if this test file shows up in the Testing tool then you can also debug it from there.

Wingware Support's avatar
4k
Wingware Support
answered 2023-06-05 07:57:15 -0500
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