Skip to content

Commit

Permalink
Refactor environment and Celery configuration setup
Browse files Browse the repository at this point in the history
Relocated Django settings initialization in manage.py into the main function for improved execution. Updated Celery configuration to load settings from Django's settings module, ensuring consistency and adaptability in different environments.
  • Loading branch information
hareshkainthdbt committed Dec 7, 2024
1 parent 13cd50c commit 1d5ad57
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion fbr/config/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

celery_app = Celery("fbr_celery")

celery_app.config_from_object("fbr.config.settings.local", namespace="CELERY")
celery_app.config_from_object("django.conf:settings", namespace="CELERY")

celery_app.autodiscover_tasks()

Expand Down
8 changes: 1 addition & 7 deletions fbr/manage.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# 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
Expand Down

0 comments on commit 1d5ad57

Please sign in to comment.