Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django+;未找到Heroku芹菜模块_Django_Heroku_Celery_Django Celery - Fatal编程技术网

Django+;未找到Heroku芹菜模块

Django+;未找到Heroku芹菜模块,django,heroku,celery,django-celery,Django,Heroku,Celery,Django Celery,我正在尝试将我的最新版本的webapp live推送到Heroku。我很乐意推希罗库,但这似乎不太合适。出于某种原因,我觉得Heroku跳过了我的requirements.txt。以防我在Heroku应用程序上手动安装芹菜 我在芹菜上遇到了这个特殊的问题,但是如果Heroku跳过我的requirements.txt,这可能是一个更大的问题 1.如果我跑步: heroku run pip install celery 这让我一遍又一遍地安装这个包,它不应该回退一个“需求已经满足”的错误吗 2.当

我正在尝试将我的最新版本的webapp live推送到Heroku。我很乐意推希罗库,但这似乎不太合适。出于某种原因,我觉得Heroku跳过了我的requirements.txt。以防我在Heroku应用程序上手动安装芹菜

我在芹菜上遇到了这个特殊的问题,但是如果Heroku跳过我的requirements.txt,这可能是一个更大的问题

1.如果我跑步:

heroku run pip install celery
这让我一遍又一遍地安装这个包,它不应该回退一个“需求已经满足”的错误吗

2.当我试着推希罗库时,我总是得到一个

File "/app/config/_celery.py", line 4, in <module>
from celery import Celery
ModuleNotFoundError: No module named 'celery'
\u芹菜.py

from __future__ import absolute_import, unicode_literals
import sys
import os
from celery import Celery
from celery.schedules import crontab

# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.production')

app = Celery('POTRTMS')
# Using a string here means the worker don't have to serialize
# the configuration object to child processes.
# - namespace='CELERY' means all celery-related configuration keys
#   should have a `CELERY_` prefix.
app.config_from_object('django.conf:settings', namespace='CELERY')

# Load task modules from all registered Django app configs.
app.autodiscover_tasks()

@app.task(bind=True)
def debug_task(self):
  print('Request: {0!r}'.format(self.request))


app.conf.beat_schedule = {
    'insurance_date': {
        'task': 'insurance_date',
        'schedule': crontab(minute=0, hour=8),

    },
}
\uuuu init.py\uuuu

from __future__ import absolute_import

from ._celery import app as celery_app

我能解决这个问题。在我的项目根文件夹中,我有Pipfile和Pipfile.lock,这听起来像是执行requirements.txt的新方法


我不确定这些文件是如何进入我的项目的,但在删除它们之后,它们都正常工作了

我能解决这个问题。在我的项目根文件夹中,我有Pipfile和Pipfile.lock,这听起来像是执行requirements.txt的新方法

我不确定这些文件是如何进入我的项目的,但在删除它们之后,它们都正常工作了

from __future__ import absolute_import

from ._celery import app as celery_app