我正在尝试为 django 创建一个可以运行的自定义命令python manage.py cert_transparency,我已经快完成了,但遇到了一些麻烦。这个的目的是在后台创建一个 24/7 运行的命令,我只是在 docker 容器中运行它。
我收到此错误消息
certificate_update: 0cert [00:00, ?cert/s]Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 371, in execute
output = self.handle(*args, **options)
File "/src/scraper/management/commands/cert_transparency.py", line 184, in handle
certstream.listen_for_events(callback, url=certstream_url)
NameError: name 'callback' is not defined
基本上我想做的只是将此脚本作为 django 中的自定义管理命令导入。
哆啦的时光机
相关分类