jcass77 / django-apscheduler

APScheduler for Django
MIT License
669 stars 97 forks source link

Execute scheduler.start() in app.ready() raise Exception #150

Closed zmmfsj-z closed 3 years ago

zmmfsj-z commented 3 years ago

When I run 'python manage.py migrate' (I'm runing my django project to a new server) raise django.db.utils.ProgrammingError: Error: The relationship "django_apscheduler_djangojobexecution" does not exist eg: scheduler.start() in app.ready()

jcass77 commented 3 years ago

Starting a scheduler inside one of your other Django apps is not safe, and not recommended. Please refer to the README for details.

In your specific instance, the scheduler is probably trying to start up before the migration command has had a chance to finish (but you are likely to encounter other issues with that approach as well).