I am trying to debug my Django project via Eclipse. The app works fine when I type the url into the browser after starting the server via the command prompt. Now I want to debug it.
I have done the following: I have set up a debug/run configuration: In the configuration's Main tab it points to the project and to views.py. In the arguments tab I have Program arguments: runserver --noreload. (I write debug/run configuration because it seems to go to the same configuration, whether I do "Debug as" or "Run as".)
I have added a breakpoint to my code.
I am confused about whether I should first start the server via the command prompt; I have therefore tried both ways. And I am confused about whether I should do "Run as" or "Debug as" from Eclipse. I have therefore tried all combis:
combi 1: Run server via command prompt. Click on my project (or module- tried both) and then select "Run as/Run Configuration". Select my new configuration and run. Result: the console title bar reads: --noreload. If I now type the url into the browser, it works fine, not stopping at the breakpoint.
combi 2: Run server via command prompt. Click on my project (or module- tried both) and then select "Debug as/Debug Configuration". Select my new configuration and run. Result: the console title bar reads: views.py. In the console it reads "pydev debugger: starting" If I now type the url into the browser, it works fine, not stopping at the breakpoint.
combi 3/4: Server is not running from the command prompt. Same result as 1 and 2, except that the browser cannot connect to localhost.
I read a tutorial that said to have DJANGO_SETTINGS_MODULE set to value settings and PYTHONPATH set to value $PWD. When I do this I get an error that it can't find my settings file. I therefore left these out, also because I saw another tutorial where they were not set at all.