我的docker contianer django服务器,postgres,芹菜工人和芹菜节拍。单独运行应用程序连接到数据库没有问题,但是,当更新数据库的定时任务运行时,我得到一个错误
celery_1 | django.db.utils.OperationalError: could not connect to server: No such file or directory
celery_1 | Is the server running locally and accepting
celery_1 | connecti
我正在使用环境键进行更好的设置配置。最初,我得到了以下错误
django.core.exceptions.ImproperlyConfigured: Set the DATABASE_URL environment variable
因此,我在google中搜索并找到了以下解决方案
settings/base.py
import os
with open('.envs/.local/.postgres') as fh:
os.environ.update(line.strip().split('=', 1) for line in fh)
然而,这也给
目前有一个被篡改的django应用程序,并打算使用芹菜来处理长期运行的任务。但是Docker-compose失败了,有以下错误:
[2018-12-17 17:25:59,710: ERROR/MainProcess] consumer: Cannot
connect to redis://redis:6379//: Error -2 connecting to redis:6379.
Name or service not known..
在SOF上有一些类似的问题,但是它们似乎都集中在CELERY_BROKER_URL in settings.py上,我相信我已经正确地设置了如下
CE
我正在使用Docker运行我的Django应用程序,其中有多个图像: PostgreSQL、celery_worker、celery_beat和django_app。除了celery_beat,他们都很好。我正在使用这个命令来构建docker:
docker-compose -f docker-compose.yml up -d --build
当我打开Desktop时,我看到它重新启动了所有映像,一切正常工作了几秒钟,然后退出芹菜拍打,返回芹菜拍打图像,并出现以下错误:
[2022-10-13 15:34:59,440: WARNING/MainProcess] could not conn
我在端口6379上运行了一个redis容器,但是django应用程序无法连接到该端口。
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f62c020fec99 sp_ask_dashboard_celery_worker "sh -c 'cd sp_dashbo…" 39 minutes ago
这个社区是我解决这个问题的最后手段,因为我已经和这个问题斗争了好几个小时了:
我在一个项目中尝试使用docker-compose run runserver python3.6 manage.py test命令进行测试,但是,我不明白它从何而来,以及如何解决这个问题。以下是我的错误
/usr/local/lib/python3.6/dist-packages/django/db/backends/postgresql/base.py:267: RuntimeWarning: Normally Django will use a connection to the 'postgres
我们有一个部署在AWS中的Terraform应用程序。
Terraform负责创建所有所需的资源是AWS,包括芹菜,节拍和花卉,以及烧瓶应用ec2实例。
我的芹菜在本地主机上运行,所有任务都正确注册。然而,当我在AWS中部署应用程序时,我在花式仪表板上得到了一个NotRegistered("<name of the >")。我还在Received unregistered task of type: <name of the task>日志中的芹菜工人的日志中找到了CloudWatch。
# The file in the terraform where
运行docker-compose -f production.yml up最终将返回:
postgres_1 | Connection matched pg_hba.conf line 95: "host all all all md5"
django_1 | PostgreSQL is unavailable (sleeping)...
postgres_1 | 2018-03-21 07:48:35.575 UTC [120] FATAL: password authentication failed for user "Db
我把姜戈和芹菜一起用。我需要关闭每天在协调世界时4点运行的celery.backend_cleanup。我一直在看文档,但找不到如何禁用它。下面是我的最后一次尝试:
celery.py
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from celery import Celery
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
考虑这一次巴什会议:
$ export DJANGO_SETTINGS_MODULE=web.settings
$ celery status -b redis://redis.businessoptics.dev:6379/1 -t 10
Error: No nodes replied within time constraint.
$ celery status -b redis://redis.businessoptics.dev:6379/1 -t 10 -A scaffold.tasks.celery_app
celery@worker.9e2c39a1c42c: OK
为什么我需要
好朋友,我正在用django 1.11开发一个在windows上使用docker的应用程序,最近更新了项目的git存储库,还用docker容器做了一些更改。
问题是,当进入主页和其他一些URLS时,什么也没有发生,但当我尝试登录到管理员时,django容器被关闭,我甚至没有收到浏览器、控制台或日志的任何错误。
示例:
当我进来的时候他们都很好
GET / 200 OK
POST / 403禁止
不允许GET / api / auth / 405方法
但当我输入它们时,没有显示任何消息,请关闭停靠容器(proyect_django_1退出,代码为0)
GET / admin无应答
POST /
我和芹菜和红葡萄酒一起流淌着。默认情况下,这会将dag的任务发送给芹菜工人。我想通过python代码从DAG的任务中运行一个自定义任务。
在tasks.py中,我有以下代码。
from airflow.configuration import conf
from airflow.config_templates.default_celery import DEFAULT_CELERY_CONFIG
from celery import Celery
from celery import shared_task
if conf.has_option('celery',
我必须在RabbitMQ 3.6.10中使用芹菜4.0.2来处理异步任务。然后,我遵循了本教程:
然而,我的任务有点问题,因为不可能有结果。我的任务总是处于“待定”状态。
我的问题是我要怎么做才能得到结果?
提前谢谢你的答复。
这里我的代码:
在这里,我的__init_.py:
from __future__ import absolute_import, unicode_literals
# This will make sure the app is always imported when
# Django starts so that shared_task will use thi
当我尝试执行命令celery -A novopagamento worker -l info时,我收到以下错误:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/celery/app/utils.py", line 365, in find_app
found = sym.app
AttributeError: module 'novopagamento' has no attribute 'app'
During han