Skip to main content

Celery Eye - Django app to monitor and view Celery task logs in the admin panel

Project description

Celery Eye

Celery Eye is a Django app that logs and displays Celery task execution details in the Django Admin panel. It enables developers and operators to monitor task history, status, and performance directly from the web UI.


🚀 Features

  • Logs all executed Celery tasks in real-time
  • View task name, status, start time, end time, and more
  • Admin interface to search, filter, and debug tasks
  • Lightweight and easy to integrate
  • Works with Redis and Celery 5+

📦 Installation

pip install celery-eye

🛠️ Prerequisites

Before installing celery-eye, ensure your Django project is already configured with Celery and Redis.


🔧 Project Setup

1. Configure celery.py

Create a celery.py file in your main Django project folder (same level as settings.py):

# myproject/celery.py
import os
from celery import Celery

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')

app = Celery('myproject')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()

2. Update __init__.py to initialize Celery

# myproject/__init__.py
from .celery import app as celery_app

__all__ = ['celery_app']

⚙️ settings.py Configuration

Add the following Celery and Redis configuration in your settings.py:

import os

# Celery Configuration
CELERY_BROKER_URL = os.getenv("CELERY_BROKER_URL", "redis://localhost:6379/0")
CELERY_ACCEPT_CONTENT = ["json"]
CELERY_TASK_SERIALIZER = "json"
CELERY_TIMEZONE = os.getenv("DEFAULT_TIMEZONE", "UTC")  # or your desired timezone

Make sure you have Redis running locally or remotely.


🧩 Django Integration

1. Add celery_eye to INSTALLED_APPS

INSTALLED_APPS = [
    ...
    'celery_eye',
]

2. Run migrations

python manage.py migrate

3. Create a superuser (if you haven't)

python manage.py createsuperuser

4. Start your services

Make sure your services are running:

# Run Redis
redis-server

# Run Celery Worker (in your Django root directory)
celery -A myproject worker --loglevel=info

# Run Django server
python manage.py runserver

You should now be able to:

  • See Celery task execution logs in the Django Admin
  • Filter/search by status, task name, and timestamps

🧪 Example Task

# any_app/tasks.py
from celery import shared_task

@shared_task
def test_task(x, y):
    return x + y

Trigger in a Django shell:

python manage.py shell
from any_app.tasks import test_task
test_task.delay(5, 7)

🐳 Optional: Redis with Docker

You can spin up Redis with Docker:

docker run -d -p 6379:6379 redis

🤝 Contributing

Pull requests, issues, and feature suggestions are welcome!


📄 License

MIT License. See LICENSE for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

celery_eye-0.1.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

celery_eye-0.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file celery_eye-0.1.1.tar.gz.

File metadata

  • Download URL: celery_eye-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for celery_eye-0.1.1.tar.gz
Algorithm Hash digest
SHA256 770cac293ae41df50889d6237277623cf655a04e0cb0f1c5e74db1f8d0091e5d
MD5 a742b374bdbec162551456dd73e1142e
BLAKE2b-256 f88528269948fe70174026419d69ef9bd26fb2e1c4be23557ec8eb23a91e316c

See more details on using hashes here.

File details

Details for the file celery_eye-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: celery_eye-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for celery_eye-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f66db934820cfc6e255b4ec3714923dfa794b20c198d732e76c7396c21579df3
MD5 8946d7229202821006fbf0b5cc9e0654
BLAKE2b-256 dcde9013b5aa651987428a31e85b6de77cff07363f88e552825790cad5287356

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page