沼泽龙通知
swampdragon-notifications的Python项目详细描述
#沼泽龙通知
[![Jonashagstedt/沼泽龙通知的代码状态](https://codeship.com/projects/fc0d69b0-9763-0132-b800-6a66c6b56914/status?branch=master)(https://codeship.com/projects/63149)
实时通知用户。
**注意**由于通知并不总是系统的重要部分,只有登录的用户才能收到通知。
"沼泽龙连接通知",
]
和/ LT;!--沼泽龙-->;
{%swarmdragon_settings%}
<;script type="text/javascript" src="{%static"沼泽龙/js/dist/swarmdragon.min.js%}">;
<;!--沼泽之龙通知-->;
<;script type="text/javascript" src="{%static"js/dist/smapdragon notifications.js%}">;
javascript api
console.log(count);
};
通知
启用桌面通知:`notifications.enableDesktopNotifications();`.
禁用桌面通知:`notifications.disableDesktopNotifications();`.
触发桌面通知:
var payload={
body:notificiati在.some_value上,
icon:notification.icon/假设图标url可用,
标记:'foo'
}
notifications.desktopnotification('new foo',payload);
设置和实时通知。
要禁用电子邮件通知,请从"沼泽龙通知"后端删除"沼泽龙通知。后端。电子邮件通知。电子邮件通知"。
n_notifications.backends.realtime_notifications.realtimeNotification'),
('email','smapdragon_notifications.backends.email_notifications.emailnotifications'),
]
'foo':{
'processor':'app.t嫒renderer.foo嫒u to嫒dict',
icon':'http://placekitten.com/g/64/64',
subject':'a new foo',
template':'new嫒foo嫒notification',
}
smap嫒dragon嫒heartbeat嫒enabled=true
smap嫒dragon嫒heartbeat嫒frequency=1000*60*5五分钟
对于要传递给客户端的任何数据,
字典。
示例处理器:
def foo_处理器(notif确认,**kwargs):
返回{
"foo_id":通知.subject.pk,
"timestamp":now(),
"extra_value":kwargs.get('extra_value')
}
IS有助于跟踪谁在线。
swarm_dragon_heartbeat_enabled=true
swarm_dragon_heartbeat_frequency=1000*60*5 5分钟
/>这是一本字典:
swamp戋dragon戋notifications={
'foo':{
'processor':'app.subject戋renderer.foo戋to戋dict'
'template':'standard戋email',仅用于电子邮件后端,
'subject':'亲爱的{},您有一个新通知',仅用于电子邮件后端
"title":"notification",
"icon":"http://placekitten.com/g/64/64"
}
}
"template"和"subject"仅与默认电子邮件后端有关。
"notification backends
位置后端:电子邮件和实时。
il_notifications.email notification'),
]
`'swamdragon_notifications.backends.realtime_notifications.realtimeNotification'`默认启用。
nge发件人电子邮件地址在"设置"中指定"通知发件人"。
\选项:`in your custom notification backend
from smapdragon_notifications.backends.base_backend import basebackend
class foonnotificationbackend(basebackend):
def notify(self,notification):
3.将新的后端添加到您的设置中
[![Jonashagstedt/沼泽龙通知的代码状态](https://codeship.com/projects/fc0d69b0-9763-0132-b800-6a66c6b56914/status?branch=master)(https://codeship.com/projects/63149)
实时通知用户。
**注意**由于通知并不总是系统的重要部分,只有登录的用户才能收到通知。
"沼泽龙连接通知",
]
和/ LT;!--沼泽龙-->;
{%swarmdragon_settings%}
<;script type="text/javascript" src="{%static"沼泽龙/js/dist/swarmdragon.min.js%}">;
<;!--沼泽之龙通知-->;
<;script type="text/javascript" src="{%static"js/dist/smapdragon notifications.js%}">;
javascript api
console.log(count);
};
通知
启用桌面通知:`notifications.enableDesktopNotifications();`.
禁用桌面通知:`notifications.disableDesktopNotifications();`.
触发桌面通知:
var payload={
body:notificiati在.some_value上,
icon:notification.icon/假设图标url可用,
标记:'foo'
}
notifications.desktopnotification('new foo',payload);
设置和实时通知。
要禁用电子邮件通知,请从"沼泽龙通知"后端删除"沼泽龙通知。后端。电子邮件通知。电子邮件通知"。
n_notifications.backends.realtime_notifications.realtimeNotification'),
('email','smapdragon_notifications.backends.email_notifications.emailnotifications'),
]
'processor':'app.t嫒renderer.foo嫒u to嫒dict',
icon':'http://placekitten.com/g/64/64',
subject':'a new foo',
template':'new嫒foo嫒notification',
}
smap嫒dragon嫒heartbeat嫒enabled=true
smap嫒dragon嫒heartbeat嫒frequency=1000*60*5五分钟
对于要传递给客户端的任何数据,
字典。
示例处理器:
def foo_处理器(notif确认,**kwargs):
返回{
"foo_id":通知.subject.pk,
"timestamp":now(),
"extra_value":kwargs.get('extra_value')
}
IS有助于跟踪谁在线。
swarm_dragon_heartbeat_enabled=true
swarm_dragon_heartbeat_frequency=1000*60*5 5分钟
/>这是一本字典:
swamp戋dragon戋notifications={
'foo':{
'processor':'app.subject戋renderer.foo戋to戋dict'
'template':'standard戋email',仅用于电子邮件后端,
'subject':'亲爱的{},您有一个新通知',仅用于电子邮件后端
"title":"notification",
"icon":"http://placekitten.com/g/64/64"
}
}
"template"和"subject"仅与默认电子邮件后端有关。
"notification backends
位置后端:电子邮件和实时。
il_notifications.email notification'),
]
`'swamdragon_notifications.backends.realtime_notifications.realtimeNotification'`默认启用。
nge发件人电子邮件地址在"设置"中指定"通知发件人"。
\选项:`in your custom notification backend
from smapdragon_notifications.backends.base_backend import basebackend
class foonnotificationbackend(basebackend):
def notify(self,notification):
3.将新的后端添加到您的设置中