I'm trying to work out how to run the debug stuff that pycharm seems to offer (well, it allows me to set breakpoints, anyway, so i'm assuming there's a nice gui for it)
I've concluded that i cannot use the ctrl-shift-r and then "runserver" command, and that instead i'd need to setup a "run configuration"? I made a "django server" one, but i don't know what values to put etc. When i run it, it tells me that some setting is wrong - i'm pretty sure it isn't, because the standard "runserver" command works fine.
And that's about all i concluded. If there is a nifty tutorial or steps to get it so i can
i'd be thrilled!
cheers!
UPDATE: in case you're wondering, here is the error i got:
Traceback (most recent call last):
File "manage.py", line 11, in import settings
File "C:\development\PycharmProjects\dumpstown\settings.py", line 185, in add_to_builtins('gravatar.templatetags.gravatar')
File "C:\development\python\lib\site-packages\django\template\base.py", line 1017, in add_to_builtins
builtins.append(import_library(module))
File "C:\development\python\lib\site-packages\django\template\base.py", line 963, in import_library
raise InvalidTemplateLibrary("ImportError raised loading %s: %s" % (taglib_module, e))
django.template.base.InvalidTemplateLibrary: ImportError raised loading gravatar.templatetags.gravatar: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.
Where the application itself, on a "runserver" never has any issues.
UPDATE: as per my answer below, pycharm is broken for add_to_builtins.
Setup your virtual environment
Set a breakpoint
Hit the Run in debug mode button.
Next to the Green play button there is a button with a bug on it. Use that to launch the runserver in debug mode. Now when you use your web application and the code hits the breakpoint it will stop there and you will be able to step in and over or resume in pycharm.
You can look at http://garmoncheg.blogspot.it/2012/01/establishing-dev-environment-with.html too
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With