Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I enable remote celery debugging in PyCharm?

I'm trying to find some instructions on how to enable PyCharm debugging within my celery processes on a remote machine. The remote machine is running Ubuntu 14.04.

I am running PyCharm 4.x.

I've seen some other information that alludes others have it working, but haven't been able to locate any proper instructions.

like image 433
Ryan Avatar asked Mar 28 '15 01:03

Ryan


People also ask

How do I enable debugging actions in PyCharm?

Just right-click any line in the editor and select the Debug <filename> command from the context menu. After the program has been suspended, use the debugger to get the information about the state of the program and how it changes during running.

How do I run celery in PyCharm?

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.

How do I run celery in Debug mode?

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.

What is remote debugging in PyCharm?

With PyCharm you can debug your application using an interpreter that is located on the other computer, for example, on a web server or dedicated test machine. PyCharm provides two ways to debug remotely: Through a remote interpreter.


1 Answers

You can have a Run Configuration to run your celery workers which then allows you to debug simply by clicking the debug button. Here is how I set that up in PyCharm 5:

pycharm celery

You need to set up a remote python interpreter and then set other configs like the image above. Note that the Working directory is pointing to the bin folder of the remote interpreter with celery installed.

like image 87
Sam R. Avatar answered Sep 20 '22 13:09

Sam R.