通过API Rest公开的django通知包
django-notifications-rest的Python项目详细描述
django-notifications-rest
文档
django-notifications-rest为django-notifications-hq
提供rest端点。在
要求
- Python 3.5、3.6、3.7、3.8
- Django 2.2、3.0、3.1
- django通知hq最新版本
- djangorestframework最新版本
安装
使用pip
安装。您需要手动安装所需的django-notifications-hq
和djangorestframework
包。在
$ pip install django-notifications-rest
或者从源头得到
^{pr2}$然后,要将Django通知Rest添加到项目中,请将应用程序notifications_rest
添加到INSTALLED_APPS
和urlconf中。在
应用程序应该在所有要生成通知的应用程序之后的某个位置,比如django.contrib.auth
INSTALLED_APPS = (
'django.contrib.auth',
'rest_framework',
'notifications'.
...
'notifications_rest',
...
)
将通知URL添加到您的urlconf::
urlpatterns = [
...
url('^notifications/', include('notifications_rest.urls')),
...
]
如果安装的django>;=3.1,则:
from django.urls import path, include
urlpatterns = [
...
path('^notifications/', include('notifications_rest.urls')),
...
]
要运行架构迁移,请执行python manage.py migrate
。在
- 项目
标签: