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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file celery_eye-0.1.0.tar.gz.
File metadata
- Download URL: celery_eye-0.1.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6949feb914a71321e2c449906f0f38b70d690033af75c957d3b9984374e7dfd6
|
|
| MD5 |
60b9feec1295696e3c3b74b736fee131
|
|
| BLAKE2b-256 |
0c05862090ba9a606acbeb764a816eb6efb8faf75c669359da4429898e0adb35
|
File details
Details for the file celery_eye-0.1.0-py3-none-any.whl.
File metadata
- Download URL: celery_eye-0.1.0-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.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f9822f5173ab2508011c5913bf7d222f140b177571b5842ff79f1fa38fef361
|
|
| MD5 |
7e66efe5359606ed1f36bfb366e34c70
|
|
| BLAKE2b-256 |
ea3f176db937e167b43ede1cc13479a813b07d238edc047facfe9e5fd378bb62
|