AnalyzrAI / apps /core /apps.py
thejagstudio's picture
Upload 92 files
0310410 verified
raw
history blame contribute delete
694 Bytes
import os
import sys
from django.apps import AppConfig
class CoreConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "apps.core"
def ready(self):
is_runserver = len(sys.argv) > 1 and sys.argv[1] == "runserver"
if not is_runserver:
return
# With autoreload (default), only start in the child process.
# With --noreload, RUN_MAIN is never set so start directly.
uses_autoreload = "--noreload" not in sys.argv
if uses_autoreload and os.environ.get("RUN_MAIN") != "true":
return
from .tasks import start_stock_fetcher
start_stock_fetcher()