# Django-notifications-views
Django-notifications-views is an extension for Django-notifications-hq that provides a viewset for the notifications and expo notifications.
## Requirements
- Django >= 3.8 *
- Python >= 3.8 *
- django-notifications-hq >= 1.8 *
(*) Not tested with earlier versions.
## Quick Setup
Install package
pip install django-notifications-views
Add `django_notifications_views` app to INSTALLED_APPS in your django settings.py:
```python
INSTALLED_APPS = (
...,
"django.contrib.staticfiles",
"rest_framework", # required only if using the provided REST endpoints
'notifications',
'django_notifications_views',
...,
)
```
Include viewset routes
```python
from django_notifications_views.urls import router as django_notifications_views_router
your_router.registry.extend(django_notifications_views_router.registry)
```
Add the following to your settings.py if you want to enable Expo Go notifications:
```python
DJANGO_NOTIFICATIONS_VIEWS = {
'USE_EXPO_NOTIFICATIONS': True, # Set to True to enable expo notifications
'EXPO_APP_ID': '<your-expo-app-id>',
}
Then run the migrations:
python manage.py makemigrations
python manage.py migrate
## Urls
GET /api/user-notifications/ : Get all notifications for the current user
POST /api/user-notifications/read-all/ : Mark all notifications as read for the current user
GET /api/user-notifications/<int:pk>/ : Get a notification by id and mark it as read
# Expo Notifications
POST /api/expo-devices/register-device/ : Register a device to receive expo notifications
POST /api/expo-devices/unregister-device/ : Unregister a device to stop receiving expo notifications
## Contributing
- [Juan Ignacio Borrelli](https://www.linkedin.com/in/juan-ignacio-borrelli/)
Maintained and developed by [Linkchar Software Development](https://linkchar.com/).
Raw data
{
"_id": null,
"home_page": "https://github.com/nachoborrelli/Django-notifications-views",
"name": "django-notifications-views",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "django notifications hq views",
"author": "nachoborrelli",
"author_email": "nacho2911@hotmail.com",
"download_url": "https://files.pythonhosted.org/packages/39/33/c37609808679f8f2589a765aeaeddfed29d87ea64d635aa94e718ea55c18/django_notifications_views-0.3.1.tar.gz",
"platform": null,
"description": "\n# Django-notifications-views\nDjango-notifications-views is an extension for Django-notifications-hq that provides a viewset for the notifications and expo notifications.\n\n## Requirements\n- Django >= 3.8 *\n- Python >= 3.8 *\n- django-notifications-hq >= 1.8 *\n\n\n(*) Not tested with earlier versions.\n\n## Quick Setup\n\nInstall package\n\n pip install django-notifications-views\n \nAdd `django_notifications_views` app to INSTALLED_APPS in your django settings.py:\n\n```python\nINSTALLED_APPS = (\n ...,\n \"django.contrib.staticfiles\",\n \"rest_framework\", # required only if using the provided REST endpoints\n 'notifications',\n 'django_notifications_views',\n ...,\n)\n```\n \nInclude viewset routes\n\n```python\nfrom django_notifications_views.urls import router as django_notifications_views_router\nyour_router.registry.extend(django_notifications_views_router.registry)\n```\n\nAdd the following to your settings.py if you want to enable Expo Go notifications:\n\n```python\nDJANGO_NOTIFICATIONS_VIEWS = {\n 'USE_EXPO_NOTIFICATIONS': True, # Set to True to enable expo notifications\n 'EXPO_APP_ID': '<your-expo-app-id>', \n}\n\nThen run the migrations:\n\n python manage.py makemigrations\n python manage.py migrate\n\n\n## Urls\n\n GET /api/user-notifications/ : Get all notifications for the current user\n POST /api/user-notifications/read-all/ : Mark all notifications as read for the current user\n GET /api/user-notifications/<int:pk>/ : Get a notification by id and mark it as read\n\n # Expo Notifications\n POST /api/expo-devices/register-device/ : Register a device to receive expo notifications\n POST /api/expo-devices/unregister-device/ : Unregister a device to stop receiving expo notifications\n\n\n## Contributing\n\n- [Juan Ignacio Borrelli](https://www.linkedin.com/in/juan-ignacio-borrelli/)\n \n\nMaintained and developed by [Linkchar Software Development](https://linkchar.com/).\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Django-notifications-views is an extension for Django-notifications-hq that provides a viewset for the notifications.",
"version": "0.3.1",
"project_urls": {
"Homepage": "https://github.com/nachoborrelli/Django-notifications-views"
},
"split_keywords": [
"django",
"notifications",
"hq",
"views"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3933c37609808679f8f2589a765aeaeddfed29d87ea64d635aa94e718ea55c18",
"md5": "7fc0091b8c3cd29d4030587dca934eab",
"sha256": "d2c895ee7f0e4aa2968fa4ed4a482fb599f4fb7fc79be1db8de83461111d7745"
},
"downloads": -1,
"filename": "django_notifications_views-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "7fc0091b8c3cd29d4030587dca934eab",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 6941,
"upload_time": "2024-08-13T18:55:12",
"upload_time_iso_8601": "2024-08-13T18:55:12.763441Z",
"url": "https://files.pythonhosted.org/packages/39/33/c37609808679f8f2589a765aeaeddfed29d87ea64d635aa94e718ea55c18/django_notifications_views-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-13 18:55:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nachoborrelli",
"github_project": "Django-notifications-views",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "django-notifications-views"
}