{"id":20609527,"url":"https://github.com/anyidea/django-user-notification","last_synced_at":"2025-09-26T11:30:57.842Z","repository":{"id":107746048,"uuid":"550126706","full_name":"anyidea/django-user-notification","owner":"anyidea","description":"Send multiple types of notification messages to django users out of box.","archived":false,"fork":false,"pushed_at":"2024-09-11T07:27:28.000Z","size":148,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-11T14:50:29.564Z","etag":null,"topics":["aliyunsms","dingtalk","django","notifications","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anyidea.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-12T08:45:03.000Z","updated_at":"2024-09-11T07:27:32.000Z","dependencies_parsed_at":"2024-11-21T12:30:35.499Z","dependency_job_id":null,"html_url":"https://github.com/anyidea/django-user-notification","commit_stats":null,"previous_names":["anyidea/django-user-notification","wccdev/django-user-notification"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anyidea%2Fdjango-user-notification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anyidea%2Fdjango-user-notification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anyidea%2Fdjango-user-notification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anyidea%2Fdjango-user-notification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anyidea","download_url":"https://codeload.github.com/anyidea/django-user-notification/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234304873,"owners_count":18811270,"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","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":["aliyunsms","dingtalk","django","notifications","python"],"created_at":"2024-11-16T10:13:49.987Z","updated_at":"2025-09-26T11:30:52.522Z","avatar_url":"https://github.com/anyidea.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Django user notification\n\n[![CI](https://github.com/wccdev/django-user-notification/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/wccdev/django-user-notification/actions/workflows/ci.yml)\n[![GitHub license](https://img.shields.io/github/license/anyidea/django-user-notification)](https://github.com/anyidea/django-user-notification/blob/master/LICENSE)\n[![Documentation Status](https://readthedocs.org/projects/django-user-notification/badge/?version=latest)](https://django-user-notification.readthedocs.io/en/latest/?badge=latest)\n[![pypi-version](https://img.shields.io/pypi/v/django-user-notification.svg)](https://pypi.python.org/pypi/django-user-notification)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-user-notification)\n[![PyPI - Django Version](https://img.shields.io/badge/django-%3E%3D3.2-44B78B)](https://www.djangoproject.com/)\n[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nOverview\n-----\nDjango user notification is intended to provide a way to send multiple types of notification messages to django users out of box.\n\nDocumentation\n-----\non the way...\n\nRequirements\n-----\n\n* Python 3.8, 3.9, 3.10\n* Django 3.1, 3.2, 4.0, 4.1, 4.2\n\nInstallation\n-----\n\nInstall using `pip`...\n\n    pip install django-user-notification\n\nAdd `'tinymce'` and `'notification'` to your `INSTALLED_APPS` setting.\n```python\nINSTALLED_APPS = [\n    'django.contrib.admin',\n    ...\n    'tinymce',\n    'notification',\n]\n```\n\nQuick Start\n-----\n\nLet's take a look at a quick start of using Django user notification to send notification messages to users.\n\nRun the `notification` migrations using:\n\n    python manage.py migrate notification\n\n\nAdd the following to your `settings.py` module:\n\n```python\nINSTALLED_APPS = [\n    ...  # Make sure to include the default installed apps here.\n    'tinymce',\n    'notification',\n]\n\nDJANGO_USER_NOTIFICATION = {\n    \"aliyunsms\": {\n        \"access_key_id\": \"Your Access Key ID\",\n        \"access_key_secret\": \"Your Access Key Secret\",\n        \"sign_name\": \"Your Sign Name\",\n    },\n    \"dingtalkchatbot\": {\n        \"webhook\": \"Your Webhook URL\",\n    },\n    \"dingtalkworkmessage\": {\n        \"agent_id\": \"Your App Agent ID\",\n        \"app_key\": \"Your App Key\",\n        \"app_secret\": \"Your App Secret\",\n    },\n    \"dingtalktodotask\": {\n        \"app_key\": \"Your App Key\",\n        \"app_secret\": \"Your App Secret\",\n    },\n}\n```\n\nLet's send a notification\n\n``` {.python}\nfrom django.contrib.auth import get_user_model\nfrom notification.backends import notify_by_email, notify_by_dingtalk_workmessage\n\nUser = get_user_model()\n\nrecipient = User.objects.first()\n\n# send a dingtalk work message notification\nnotify_by_dingtalk_workmessage([recipient], phone_field=\"phone\", title=\"This is a title\", message=\"A test message\")\n\n\n# send a email notiofication\nnotify_by_email([recipient], title=\"This is a title\", message=\"A test message\")\n```\n\n\nSend Message With Template\n--------------\n\n`django-user-notification` support send notifications with custom template, To\nspecify a custom message template you can provide the `template_code`\nand `context` parameters.\n\n1)  Create a template message with code named `TMP01` on django admin\n\n2)  Provide the `template_code` and `context` to `send` method:\n``` {.python}\n...\n\nnotify_by_email([recipient], template_code=\"TMP01\", context={\"content\": \"Hello\"})\n```\n\nSupported backends\n-----------------------------\n\n- `DummyNotificationBackend`: send dummy message\n- `EmailNotificationBackend`: send email notification.\n- `WebsocketNotificationBackend`: send webdocket notification, need install extension: `channels`.\n- `AliyunSMSNotificationBackend`: send aliyun sms notification, need install extension: `aliyunsms`.\n- `DingTalkChatbotNotificationBackend`: send dingtalk chatbot notification.\n- `DingTalkToDoTaskNotificationBackend`: send dingtalk todo tasks notification\n- `DingTalkWorkMessageNotificationBackend`: send dingtalk work message notification.\n- `WechatNotificationBackend`: planning...\n\nRunning the tests\n-----------------\n\nTo run the tests against the current environment:\n\n``` {.bash}\n$ pytest tests/\n```\n\nChangelog\n---------\n\n### 0.7.0\n\n-   Initial release\n\nContributing\n------------\nAs an open source project, we welcome contributions. The code lives on [GitHub](https://github.com/anyidea/django-user-notification/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanyidea%2Fdjango-user-notification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanyidea%2Fdjango-user-notification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanyidea%2Fdjango-user-notification/lists"}