How can I use PyCharm to locally debug a Celery worker?(如何使用 PyCharm 在本地调试 Celery worker?)
问题描述
我有一个带有 virtualenv 的现有 Django 项目.激活 venv 后,我可以使用命令 celery
运行 Celery.这适用于 Windows、OS X 和 Linux.
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.
我想在 Windows 上试用 PyCharm,我可以让它运行我的 Django 服务器(使用项目的 venv),但我也想运行 Celery,所以我也可以调试它.
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.
我找不到简单、直接的 PyCharm 设置指南,以便我可以调试 Celery(某种方式可以在任何平台上使用 PyCharm).
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).
推荐答案
这就是我运行 celery 的方法
This is what I do to run celery
转到Edit Configuration
,然后选择+"图标添加新的Python脚本并输入芹菜路径、其他参数和工作目录.您可以指定环境变量,并且您还可以选择要包含的父环境.另外,不要忘记选择你的 python 解释器来处理虚拟环境.
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.
这篇关于如何使用 PyCharm 在本地调试 Celery worker?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 PyCharm 在本地调试 Celery worker?


- 如何使用PYSPARK从Spark获得批次行 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01
- 我如何透明地重定向一个Python导入? 2022-01-01
- YouTube API v3 返回截断的观看记录 2022-01-01
- 计算测试数量的Python单元测试 2022-01-01
- 使用 Cython 将 Python 链接到共享库 2022-01-01
- 我如何卸载 PyTorch? 2022-01-01
- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01
- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01