Skip to main content

通过 API Rest 暴露的 django 通知包

项目描述

django-notifications-rest文档

django-notifications-rest为django-notifications-hq.

要求

  • 蟒蛇 3.5、3.6、3.7、3.8
  • Django 2.2、3.0、3.1
  • django-notifications-hq 最新版本
  • djangorestframework 最新版本

安装

安装使用pip. 您需要手动安装所需的django-notifications-hq软件包djangorestframework。

$ pip install django-notifications-rest

或从源头获取

$ git clone https://github.com/yhdelgado/django-notifications-rest.git
$ cd django-notifications-rest
$ python setup.py sdist
$ pip install dist/django-notifications-rest*

然后将 Django Notifications Rest 添加到您的项目中,将应用程序添加notifications_rest到您的INSTALLED_APPS和 urlconf 中。

该应用程序应该在所有将生成通知的应用程序之后去某个地方,例如django.contrib.auth

INSTALLED_APPS = (
    'django.contrib.auth',
    'rest_framework',
    'notifications'.
    ...
    'notifications_rest',
    ...
)

将通知网址添加到您的 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.

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

django-notifications-rest-0.0.1.tar.gz (4.7 kB 查看哈希)

已上传 source

内置分布

django_notifications_rest-0.0.1-py2.py3-none-any.whl (5.7 kB 查看哈希)

已上传 py2 py3