简体   繁体   English

django-celery-beat不创建表

[英]django-celery-beat not creating tables

I've installed django-celery-beat via: 我已经通过以下方式安装了django-celery-beat:

pip install django-celery-beat

Installed the app on my django project 在我的Django项目上安装了该应用

INSTALLED_APPS = [
...
'django_celery_beat',
...
 ]

ran migration via 通过进行迁移

python manage.py migrate django-celery-beat

I don't get any error message, and I can go to my django admin site and I see the Periodic Task section with Crontab,Intervals, Periodic Tasks, and Solar events sections. 我没有收到任何错误消息,可以转到django管理站点,看到带有Crontab,“间隔”,“周期性任务”和“太阳事件”部分的“周期性任务”部分。 However when I click into any of them I get a message about the table not existing. 但是,当我单击其中任何一个时,都会收到有关该表不存在的消息。

(1146, "Table 'mydatabase.django_celery_beat_periodtask' doesn't exist")

I've checked my mysql database and in fact there are no tables. 我已经检查了我的mysql数据库,实际上没有表。

Any idea of how to force the creation of the tables? 关于如何强制创建表的任何想法?

It seems a certain version present on PyPI does not contain the migrations. 似乎PyPI上存在的某个版本不包含迁移。 Someone placed a similar issue/question on the repository's issue tracker but it should have been fixed by now. 有人在存储库的问题跟踪器上放置了类似的问题/问题,但现在应该已经解决了。

Anyway, you could try: 无论如何,您可以尝试:

python manage.py makemigrations python manage.py makemigrations

then 然后

python manage.py migrate python manage.py迁移

however I would be cautious using this in production. 但是我会在生产中谨慎使用它。

Note : It seems there are more reports of this kind of problems related to version 1.1.0 , on the issue tracker. 注意 :似乎在问题跟踪器上有更多与1.1.0版相关的此类问题的报告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM