Skip to content

Commit

Permalink
Merge pull request #92 from uktrade/feature/resolve-celery
Browse files Browse the repository at this point in the history
Initialize Django setup at the start of manage.py
  • Loading branch information
hareshkainthdbt authored Dec 7, 2024
2 parents 79bba4a + 13cd50c commit 77b2296
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 0 additions & 3 deletions fbr/config/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
from celery.schedules import crontab
from dbt_copilot_python.celery_health_check import healthcheck

import django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
django.setup()

celery_app = Celery("fbr_celery")

Expand Down
9 changes: 8 additions & 1 deletion fbr/manage.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# flake8: noqa

#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
import django

django.setup()


def main():
"""Run administrative tasks."""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")

try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand Down

0 comments on commit 77b2296

Please sign in to comment.