I have an existing Django project with a virtualenv. After activating the venv, I can run Celery just with the command celery
. This works on Windows, OS X and Linux.
I wanted to try PyCharm on Windows, and I'm able to get it to run my Django server (using the project's venv), but I also want to run Celery, so I can debug that as well.
I can't find a simple, straightforward guide to setting up PyCharm so I can debug Celery (in a manner will work with PyCharm on any platform).
Go to Edit Configuration , then select the '+' icon to add new Python script and enter the celery path, other parameters and working directory. You can specify environment variables and bottom of that you have the option to select parent environment to include as well.
First, I open my project in Eclipse and put a breakpoint at the beginning of the task function. Then, I'm starting the Celery workers from Eclipse by Right Clicking on manage.py from the PyDev Package Explorer and choosing "Debug As->Python Run" and specifying "celeryd -l info" as the argument.
In PyCharm debugger, you can preview int variables in the hexadecimal or binary format. This might be particularly helpful when you debug network scripts that include binary protocols.
Start debuggingOpen the HTML file that references the JavaScript to debug or select the HTML file in the Project tool window. From the context menu of the editor or the selection, choose Debug <HTML_file_name>. PyCharm generates a debug configuration and starts a debugging session through it.
This is what I do to run celery
Go to Edit Configuration
, then select the '+' icon to add new Python script and enter the celery path, other parameters and working directory. You can specify environment variables and bottom of that you have the option to select parent environment to include as well. Also, don't forget to choose your python interpreter for taking care of virtual environment.
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