import os
from django.conf import settings

BASE_DIR = os.path.dirname(os.path.abspath(__file__))

import dj_database_url
DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.sqlite3',
         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
     }
}

if dj_database_url.config():
    settings.DATABASES['default'] =  dj_database_url.config()

if not settings.configured:
    settings.configure()

from pypnrstatus.tasks import *
from pypnrstatus.models import *
from datetime import timedelta, datetime
import time

while True:
    pnr_notifications = PNRNotification.objects.filter(next_schedule_time__lte=datetime.now()+timedelta(minutes=5))
    for pnr_notification in pnr_notifications:
        schedule_pnr_notification(pnr_notification)
    time.sleep(5*60) 

@@ -92,16 +92,69 @@
 le__))%0A%0A
+if not settings.configured:%0A    settings.configure()%0A
 import d
@@ -410,61 +410,8 @@
 ()%0A%0A
-if not settings.configured:%0A    settings.configure()%0A
 %0Afro

revert worker.py changes