{"id":27554353,"url":"https://github.com/brktrlw/django-admin-collaborator","last_synced_at":"2025-09-06T17:42:25.203Z","repository":{"id":286799224,"uuid":"962527961","full_name":"Brktrlw/django-admin-collaborator","owner":"Brktrlw","description":"Real-time collaborative editing for Django admin with WebSockets","archived":false,"fork":false,"pushed_at":"2025-05-22T17:24:40.000Z","size":3880,"stargazers_count":51,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-09T01:58:15.804Z","etag":null,"topics":["admin-interface","asgi","channels","collaboration","collaborative-editing","concurrent-editing","django","django-admin","exclusive-locking","presence","presence-indicator","python","realtime","redis","websocket","websockets"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/django-admin-collaborator/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Brktrlw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-08T09:37:39.000Z","updated_at":"2025-07-03T18:00:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"6579c95b-ea3f-4a2a-b31d-c1b83a4c383a","html_url":"https://github.com/Brktrlw/django-admin-collaborator","commit_stats":null,"previous_names":["brktrlw/django-admin-collaborator"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Brktrlw/django-admin-collaborator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brktrlw%2Fdjango-admin-collaborator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brktrlw%2Fdjango-admin-collaborator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brktrlw%2Fdjango-admin-collaborator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brktrlw%2Fdjango-admin-collaborator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Brktrlw","download_url":"https://codeload.github.com/Brktrlw/django-admin-collaborator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brktrlw%2Fdjango-admin-collaborator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273940026,"owners_count":25195095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admin-interface","asgi","channels","collaboration","collaborative-editing","concurrent-editing","django","django-admin","exclusive-locking","presence","presence-indicator","python","realtime","redis","websocket","websockets"],"created_at":"2025-04-19T14:31:47.245Z","updated_at":"2025-09-06T17:42:25.196Z","avatar_url":"https://github.com/Brktrlw.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/brktrl"],"categories":["Third-Party Packages"],"sub_categories":["Admin"],"readme":"# Django Admin Collaborator\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/brktrl)\n[![PyPI version](https://badge.fury.io/py/django-admin-collaborator.svg)](https://badge.fury.io/py/django-admin-collaborator)\n[![Python Versions](https://img.shields.io/pypi/pyversions/django-admin-collaborator.svg)](https://pypi.org/project/django-admin-collaborator/)\n[![Django Versions](https://img.shields.io/badge/django-3.2%2B-blue.svg)](https://www.djangoproject.com/)\n[![Documentation Status](https://readthedocs.org/projects/django-admin-collaborator/badge/?version=latest)](https://django-admin-collaborator.readthedocs.io/en/latest/?badge=latest)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA Django application that enables real-time collaborative editing in the Django admin interface. This package allows multiple admin users to work together while preventing concurrent edits to the same object.\n\n## Features\n\n- ✨ **Real-time Collaborative Editing** - One user can edit while others view in real-time, preventing conflicts\n- 🔒 **Edit Lock Management** - Prevents concurrent edits to the same object\n- 👥 **User Presence Detection** - See who else is viewing the same object\n- 🔔 **Editor Attention System** - Request attention from the current editor\n- 💬 **Real-time Chat** - Chat with other users viewing the same page\n- 🗣️ **Individual Conversations** - Open separate chat windows for each user\n- 👤 **Avatar Support** - Visual user identification with customizable avatars\n- 🔌 **Redis Integration** - Reliable lock management and message distribution\n- 🔄 **Django Channels** - WebSocket-based real-time communication\n- 🛡️ **Connection Resilience** - Automatic retry mechanism for Redis operations with exponential backoff\n\n## Overview\n\n![Demo](https://raw.githubusercontent.com/Brktrlw/django-admin-collaborator/refs/heads/main/screenshots/demo.gif)\n\n## Requirements\n\n- Django 3.2+\n- Django Channels 3.0+\n- Redis server\n- Python 3.8+\n\n## Installation\n\n1. Install the package using pip:\n```bash\npip install django-admin-collaborator\n```\n\n2. Add 'django_admin_collaborator' to your INSTALLED_APPS in settings.py:\n```python\nINSTALLED_APPS = [\n    ...\n    'channels',\n    'django_admin_collaborator',\n    ...\n]\n```\n\n3. Configure your Django Channels layer in settings.py:\n```python\nCHANNEL_LAYERS = {\n    'default': {\n        'BACKEND': 'channels_redis.core.RedisChannelLayer',\n        'CONFIG': {\n            'hosts': [('127.0.0.1', 6379)],\n        },\n    },\n}\n```\n\n4. Add the WebSocket routing to your asgi.py:\n```python\ndjango_asgi_app = get_asgi_application()\nfrom django_admin_collaborator.routing import websocket_urlpatterns\n\napplication = ProtocolTypeRouter({\n    'http': get_asgi_application(),\n    'websocket': AuthMiddlewareStack(\n        URLRouter(\n            websocket_urlpatterns\n        )\n    ),\n})\n```\n\n## Configuration\n\nYou can customize the behavior of django-admin-collaborator by adding the following settings to your settings.py:\n\n```python\nADMIN_COLLABORATOR_OPTIONS = {\n    'editor_mode_text': 'You are in editor mode.',\n    'viewer_mode_text': 'This page is being edited by {editor_name}. You cannot make changes until they leave.',\n    'claiming_editor_text': 'The editor has left. The page will refresh shortly to allow editing.',\n    'avatar_field': None,  # Set to a field name in your User model to display avatars\n    'notification_request_interval': 15,  # Seconds between notification requests\n    'notification_message': 'User {username} is requesting the editors attention.',\n    'notification_button_text': 'Request Editor Attention',\n    'notification_request_sent_text': 'Request sent.',\n    # Chat settings\n    'enable_chat': True,  # Enable/disable the chat feature\n    'chat_user_list_title': 'Online Users',  # Title for the user list panel\n    'chat_empty_state_text': 'No other users online',  # Text when no users are online\n    'chat_start_conversation_text': 'No messages yet. Start the conversation!',  # Text for empty chat\n    'chat_input_placeholder': 'Type a message...',  # Placeholder text for chat input field\n    'chat_online_status_text': 'Online',  # Text for online status indicator\n}\n\nADMIN_COLLABORATOR_ADMIN_URL = 'admin'  # Your admin URL prefix\nADMIN_COLLABORATOR_REDIS_URL = 'redis://localhost:6379/0'  # Redis connection URL\nADMIN_COLLABORATOR_WEBSOCKET_CONNECTION_PREFIX_URL = 'admin/collaboration'  # WebSocket connection URL prefix\n\n# Redis connection resilience settings\nADMIN_COLLABORATOR_REDIS_MAX_RETRIES = 3  # Maximum retry attempts for Redis operations\nADMIN_COLLABORATOR_REDIS_RETRY_DELAY = 0.5  # Delay between retries in seconds (uses exponential backoff)\nADMIN_COLLABORATOR_REDIS_SOCKET_TIMEOUT = 5  # Redis connection timeout in seconds\nADMIN_COLLABORATOR_REDIS_MAX_CONNECTIONS = 10  # Maximum connections in the Redis connection pool\n```\n\n## Usage\n\n1. Add the CollaborativeAdminMixin to your ModelAdmin classes:\n```python\nfrom django_admin_collaborator.utils import CollaborativeAdminMixin\n\nclass YourModelAdmin(CollaborativeAdminMixin, admin.ModelAdmin):\n    ...\n```\n\n\n## Features in Detail\n\n### Edit Lock Management\n- Only one user can edit an object at a time\n- Automatic lock release when user disconnects\n- Visual indication of edit status\n- Automatic page refresh when edit lock is released\n\n### Real-time Communication\n- WebSocket-based communication for instant updates\n- User presence detection\n- Editor status broadcasting\n- Content update notifications\n\n### Editor Attention System\n- Users can request editor's attention\n- Configurable notification intervals\n- Customizable notification messages\n- Visual indicators for attention requests\n\n### Customization Options\n- Customizable text messages\n- Avatar support for user identification\n- Configurable notification intervals\n- Customizable admin URL prefix\n- Redis connection configuration\n\n## Security\n\n- WebSocket connections are authenticated using Django's authentication system\n- Only staff users can access collaborative features\n- Redis-based lock management ensures data consistency\n- Secure WebSocket communication\n\n## Deployment\n\n### Heroku Deployment\n\nIf you're deploying this application on Heroku, ensure that you configure the database connection settings appropriately to optimize performance:\n\n```python\n# settings.py\nif not DEBUG:\n    import django_heroku\n    django_heroku.settings(locals())\n    DATABASES['default']['CONN_MAX_AGE'] = 0\n```\n\nThese settings enable automatic retries with exponential backoff when Redis connection errors occur.\n\n## Documentation\n\nFor complete documentation, please visit:\n- [Read the Docs](https://django-admin-collaborator.readthedocs.io/)\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- Django team for their amazing framework\n- Channels team for WebSocket support\n- All contributors who have helped improve this package\n\n## Support\n\nIf you encounter any issues or have questions, please open an issue on the GitHub repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrktrlw%2Fdjango-admin-collaborator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrktrlw%2Fdjango-admin-collaborator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrktrlw%2Fdjango-admin-collaborator/lists"}