问题描述
我是django的新手,我正在尝试使用后台任务来发送邮件通知.但是我得到了错误
I am new to django and i am trying to use background-tasks for sending mail notifications. But I am getting error as
django.db.utils.OperationalError:没有这样的表:background_task
我在INSTALLED_APPS内添加了 background_task
,并经历了其他相关问题,因此尝试了
I have added background_task
inside INSTALLED_APPS and gone through other related questions asked and so tried
python manage.py makemigrations background_task
但是我仍然遇到相同的错误.我正在使用
But I am still getting same error.I am using
Django==3.0.7
django-background-tasks==1.2.5
django-compat==1.0.15
将感谢您的帮助
推荐答案
我在进行迁移和makemigrations时遇到错误,因为我先修饰函数或尝试使用表,甚至没有添加它,然后再使用migration.We应该首先迁移表,然后再迁移表.一个教训.
I was getting error with migrate and makemigrations, as I was first decorating the function or trying to use table,without it being even added and then using migrate.We should first migrate the tables and after that only we go on with using tables. A lesson learned.
这篇关于表格未为django-background-tasks创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!