{ "info": { "author": "Amos Vryhof", "author_email": "amos@vryhofresearch.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.8", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "[![Build Status](https://travis-ci.org/avryhof/django-pwa-webpush.svg)](https://travis-ci.org/avryhof/django-pwa-webpush)\n[![CodeFactor](https://www.codefactor.io/repository/github/avryhof/django-pwa-webpush/badge)](https://www.codefactor.io/repository/github/avryhof/django-pwa-webpush)\n[![codecov](https://codecov.io/gh/avryhof/django-pwa-webpush/branch/master/graph/badge.svg)](https://codecov.io/gh/avryhof/django-pwa-webpush)\n[![PyPI - Downloads](https://img.shields.io/pypi/v/django-pwa-webpush.svg)](https://pypi.org/project/django-pwa-webpush)\n[![PyPI - Downloads](https://img.shields.io/pypi/djversions/django-pwa-webpush.svg)](https://pypi.org/project/django-pwa-webpush)\n\n\nDjango-PWA-Webpush\n===================\n\nThis package is a pretty simple merge of [django-pwa](https://github.com/silviolleite/django-pwa), and [django-webpush](https://github.com/safwanrahman/django-webpush).\n\ndjango-pwa\n=====\nThis Django app turns your project into a [progressive web app](https://developers.google.com/web/progressive-web-apps/). Navigating to your site on an Android phone will prompt you to add the app to your home screen.\n\nLaunching the app from your home screen will display your app [without browser chrome](https://github.com/silviolleite/django-pwa/raw/master/images/screenshot2.png). As such, it's critical that your application provides all navigation within the HTML (no reliance on the browser back or forward button).\n\ndjango-webpush\n=====\nDjango-PWA-Webpush is a Package made for integrating and sending [Web Push Notification](https://developer.mozilla.org/en/docs/Web/API/Push_API) in Django Application.\n\nCurrently, it Supports Sending Push Notification to **Firefox 46+ and Chrome 52+**.\n\nMore at [Can I use...](https://caniuse.com/#feat=push-api)\n\nThis README\n=====\nThis readme is a sloppy copy and paste job from the READMEs of the two packages I combined. So I have also included their own README files, since they are very informative.\n\n. [django-pwa](https://github.com/avryhof/django-pwa-webpush/DJANGO-PWA-README.md)\n. [django-webpush](https://github.com/avryhof/django-pwa-webpush/DJANGO-WEBPUSH-README.md)\n\n\nRequirements\n=====\nProgressive Web Apps require HTTPS unless being served from localhost. If you're not already using HTTPS on your site, check out [Let's Encrypt](https://letsencrypt.org/) and [ZeroSSL](https://zerossl.com/).\n\n----------\nInstallation and Setup\n-------------\n\nYou can install it easily from pypi by running\n\n pip install django-pwa-webpush\n\nAfter installing the package, add `pwa_webpush` in in your `INSTALLED_APPS` settings\n\n```python\nINSTALLED_APPS = (\n ...\n 'pwa_webpush',\n)\n```\n\nYou also need these settings:\n\n```python\n\nPWA_APP_NAME = 'My App'\nPWA_APP_DESCRIPTION = \"My app description\"\nPWA_APP_THEME_COLOR = '#0A0302'\nPWA_APP_BACKGROUND_COLOR = '#ffffff'\nPWA_APP_DISPLAY = 'standalone'\nPWA_APP_SCOPE = '/',\nPWA_APP_ORIENTATION = 'any'\nPWA_APP_START_URL = '/'\nPWA_APP_ICONS = [\n {\n 'src': '/static/images/my_app_icon.png',\n 'sizes': '160x160'\n }\n]\nPWA_APP_SPLASH_SCREEN = [\n {\n 'src': '/static/images/icons/splash-640x1136.png',\n 'media': '(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)'\n }\n]\nPWA_APP_DIR = 'ltr'\nPWA_APP_LANG = 'en-US'\n\n```\n\nAll PWA_ settings are optional, and the app will work fine with its internal defaults. Highly recommend setting at least `PWA_APP_NAME`, `PWA_APP_DESCRIPTION`, `PWA_APP_ICONS` and `PWA_APP_SPLASH_SCREEN`.\n\nFor Webpush, you also need\n\n```python\n\nWEBPUSH_SETTINGS = {\n \"VAPID_PUBLIC_KEY\": \"Vapid Public Key\",\n \"VAPID_PRIVATE_KEY\":\"Vapid Private Key\",\n \"VAPID_ADMIN_EMAIL\": \"admin@example.com\"\n}\n```\n**Replace ``\"Vapid Public Key\"`` and ``\"Vapid Private Key\"`` with your Vapid Keys. Also replace ``admin@example.com`` with your email so that the push server of browser can reach to you if anything goes wrong.**\n\n> **To know how to obtain Vapid Keys please see this [`py_vapid`](https://github.com/web-push-libs/vapid/tree/master/python) and [Google Developer Documentation](https://developers.google.com/web/fundamentals/push-notifications/subscribing-a-user#how_to_create_application_server_keys). You can obtain one easily from [web-push-codelab.glitch.me](https://web-push-codelab.glitch.me/). ``Application Server Keys`` and ``Vapid Keys`` both are same.**\n\nThen include `pwa_webpush` in the `urls.py`\n\n```python\nurlpatterns = [\n url(r'', include('pwa_webpush.urls')) # You MUST use an empty string as the URL prefix\n]\n```\n\nAdd PWA Information to your template.\n-------------------\nInject the required meta tags in your base.html (or wherever your HTML <head> is defined):\n```html\n{% load pwa_webpush %}\n\n\n ...\n {% progressive_web_app_meta %}\n ...\n\n```\n\nAdd Web Push Information to your template.\n-------------------\n\nSo in template, you need to load `webpush_notifications` custom template tag by following:\n- If you are using built in templating engine, add `{% load webpush_notifications %}` in the template\n- If you are using **jinja** templating engine, you do not need to load anything.\n\nNext, inside the `` tag add `webpush_header` according to your templating engine:\n\n```html\n\n # For django templating engine\n {% webpush_header %}\n # For jinja templating engine\n {{ webpush_header() }}\n\n```\nNext, inside the `` tag, insert `webush_button` where you would like to see the **Subscribe to Push Messaging** Button. Like following\n\n```html\n\n

Hello World!

\n # For django templating engine\n {% webpush_button %}\n # For jinja templating engine\n {{ webpush_button() }}\n\n```\n\n >**Note:** The Push Notification Button will show only if the user is logged in or any `group` named is passed through `webpush` context\n\n ***If you would like to mark the subscription as a group, like all person subscribe for push notification from the template should be marked as group and would get same notification, you should pass a `webpush` context to the template through views. The `webpush` context should have a dictionary like `{\"group\": group_name}`*** . Like following\n\n```python\n webpush = {\"group\": group_name } # The group_name should be the name you would define.\n\nreturn render(request, 'template.html', {\"webpush\":webpush})\n```\n> **Note:** If you dont pass `group` through the `webpush` context, only logged in users can see the button for subscription and able to get notification.\n\n----------\n\nTroubleshooting\n=====\nWhile running the Django test server:\n\n1. Verify that `/manifest.json` is being served\n1. Verify that `/serviceworker.js` is being served\n1. Verify that `/offline` is being served\n1. Use the Application tab in the Chrome Developer Tools to verify the progressive web app is configured correctly.\n1. Use the \"Add to homescreen\" link on the Application Tab to verify you can add the app successfully.\n\nAdding Your Own Service Worker\n=====\nTo add service worker functionality, you'll want to create a `serviceworker.js` or similarly named template in a template directory, and then point at it using the PWA_SERVICE_WORKER_PATH variable (PWA_APP_FETCH_URL is passed through).\n\n```python\nPWA_SERVICE_WORKER_PATH = os.path.join(BASE_DIR, 'my_app', 'serviceworker.js')\n\n```\n\nThe offline view\n=====\nBy default, the offline view is implemented in `templates/offline.html`\nYou can overwrite it in a template directory if you continue using the default `serviceworker.js`.\n\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://www.github.com/avryhof/django-pwa-webpush", "keywords": "", "license": "GNU Public License", "maintainer": "", "maintainer_email": "", "name": "django-pwa-webpush", "package_url": "https://pypi.org/project/django-pwa-webpush/", "platform": "", "project_url": "https://pypi.org/project/django-pwa-webpush/", "project_urls": { "Homepage": "https://www.github.com/avryhof/django-pwa-webpush" }, "release_url": "https://pypi.org/project/django-pwa-webpush/1.1.0/", "requires_dist": [ "pywebpush (==1.6.0)" ], "requires_python": "", "summary": "A conglomeration of django-pwa and django-webpush.", "version": "1.1.0" }, "last_serial": 5815073, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "2b0cd7ce16d17fc3cab94fe6ccc20308", "sha256": "cd1a861089820c089f9c611229588578d3e48a304326c2ebb332f3f6a4a88b8e" }, "downloads": -1, "filename": "django_pwa_webpush-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2b0cd7ce16d17fc3cab94fe6ccc20308", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 476420, "upload_time": "2019-05-08T17:45:19", "url": "https://files.pythonhosted.org/packages/d6/5f/80e247d45cfbc8eff85ef42eed7fa435b5171769d2bd94865212bc1c94a2/django_pwa_webpush-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7fbf50114548d97a91abe98867ec4f04", "sha256": "8ac373fa6b563c968e385c218040c5a6284828d08d6a9e454fb0e611d19f6dd3" }, "downloads": -1, "filename": "django-pwa-webpush-0.0.1.tar.gz", "has_sig": false, "md5_digest": "7fbf50114548d97a91abe98867ec4f04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 477869, "upload_time": "2019-05-08T17:45:22", "url": "https://files.pythonhosted.org/packages/b8/80/1a09abe879d1ae1cab5651bd101d2313b91290ac4df703bae896ccc69001/django-pwa-webpush-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "3d99764f7b99716b2893b3c77b416983", "sha256": "3d54ae192732b4c01f7e2656ed719b00cf277064ad762ebf6786d1def6d72237" }, "downloads": -1, "filename": "django_pwa_webpush-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "3d99764f7b99716b2893b3c77b416983", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 479498, "upload_time": "2019-05-08T18:00:06", "url": "https://files.pythonhosted.org/packages/c7/9d/56b43045f9595e34850b72aa8b42b392bbb6d09a05a732092b8b88a8bf1b/django_pwa_webpush-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bdeab59899c098e23b21c4c32fbbfc57", "sha256": "93ce22daa6516baadad2eb51c3eac8e9de6af79193cc7e36a3442887638515b7" }, "downloads": -1, "filename": "django-pwa-webpush-0.0.2.tar.gz", "has_sig": false, "md5_digest": "bdeab59899c098e23b21c4c32fbbfc57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 479498, "upload_time": "2019-05-08T18:00:08", "url": "https://files.pythonhosted.org/packages/cc/35/4412f39d3e723328952d33e6f8d6c0fd59908d035a4ba058666f139c2c87/django-pwa-webpush-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "449bde31f1bc08d3206ca0884496b5a1", "sha256": "a45ca513b34f04f1066c8f89a9465f9227a3dc6d0b03d1d0f799ebbf11184e5c" }, "downloads": -1, "filename": "django_pwa_webpush-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "449bde31f1bc08d3206ca0884496b5a1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 479607, "upload_time": "2019-05-08T18:32:23", "url": "https://files.pythonhosted.org/packages/00/3a/2a87c867415e5c024db7b806eabc720c118e6b25ad392f53e71d8b4a6a92/django_pwa_webpush-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "61fe4b6f5ef4a8497934df15ac34e20d", "sha256": "41686aa3de4afeb5ad1a6197bfad8dd355bad7642dd5f73f2058bf447b4d6e65" }, "downloads": -1, "filename": "django-pwa-webpush-0.0.3.tar.gz", "has_sig": false, "md5_digest": "61fe4b6f5ef4a8497934df15ac34e20d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 479528, "upload_time": "2019-05-08T18:32:26", "url": "https://files.pythonhosted.org/packages/fb/71/ea91b761eb8ac42a602e5db701a7ab66a9740f61d9820476bac11df49835/django-pwa-webpush-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "7feca037165039a3b867957f330b4704", "sha256": "b0238f6ff2c6d45d8329447f47f249e8c7a7bc69683c6de058b3b514acaebb49" }, "downloads": -1, "filename": "django_pwa_webpush-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "7feca037165039a3b867957f330b4704", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 479600, "upload_time": "2019-05-08T18:36:09", "url": "https://files.pythonhosted.org/packages/db/27/2c4f578d651948e4d645c155af9d673accfaa456c51a3a8258868d39775e/django_pwa_webpush-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "911174749b1140c965c5775cb9c39619", "sha256": "cf86cb4d7a5fd5910e29fe2c310c574c4ef153b99f6e2dfc8cb38080f92ac903" }, "downloads": -1, "filename": "django-pwa-webpush-0.0.4.tar.gz", "has_sig": false, "md5_digest": "911174749b1140c965c5775cb9c39619", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 479518, "upload_time": "2019-05-08T18:36:12", "url": "https://files.pythonhosted.org/packages/10/2d/488b0bc72ebdf0885b0752f12ee4edc08ddcf0e49427e47c377ef6615de2/django-pwa-webpush-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "a5e61335dd027225c284ed3997a8a2c7", "sha256": "38b8411a5c492b86ba6994e0324c42ae89ba18ccccb738af4fb8dad00a057367" }, "downloads": -1, "filename": "django_pwa_webpush-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "a5e61335dd027225c284ed3997a8a2c7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 479625, "upload_time": "2019-05-08T18:42:30", "url": "https://files.pythonhosted.org/packages/da/b9/5cc387deb1948d74456ecc2f39fa6915d42cdb5a1628ab0a77207b06559f/django_pwa_webpush-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e37746bc1e3b08c3eeb66049d32c9307", "sha256": "83766d2ce404ab51923b1b437abf253e765d290438a771a724b49358323da1b6" }, "downloads": -1, "filename": "django-pwa-webpush-0.0.5.tar.gz", "has_sig": false, "md5_digest": "e37746bc1e3b08c3eeb66049d32c9307", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 479522, "upload_time": "2019-05-08T18:42:34", "url": "https://files.pythonhosted.org/packages/1a/66/c9bf0695b5e3354c91d4bec254834e65199a5c2954675f20e837e44eee6b/django-pwa-webpush-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "f59ae02c1e444ff8d26c56c6cc24a04a", "sha256": "4b20644fbf7cf0615cac858d4f660c020952658de4aca9ab4665dfecb50b8181" }, "downloads": -1, "filename": "django_pwa_webpush-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "f59ae02c1e444ff8d26c56c6cc24a04a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 479779, "upload_time": "2019-05-08T18:54:07", "url": "https://files.pythonhosted.org/packages/14/87/e48d5f737b0ca7af0013f8d2be65ca02aeb7777fad2fa7ffab13558b8f0e/django_pwa_webpush-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ebd530797ff31db13f52709feaccb124", "sha256": "52a160f82c97c01a7e499435fae83d88790f1e1e9c088f2888bfe6a46b126425" }, "downloads": -1, "filename": "django-pwa-webpush-0.0.6.tar.gz", "has_sig": false, "md5_digest": "ebd530797ff31db13f52709feaccb124", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 479652, "upload_time": "2019-05-08T18:54:12", "url": "https://files.pythonhosted.org/packages/a4/eb/76bfed315cc55c358f9b3208538a505a38584291975fef5a68bfff00491c/django-pwa-webpush-0.0.6.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "2cb79e877c32dce7962b60b31fb30a44", "sha256": "3249e94bd2c6cf2565c84ea4a7cdf696b16c1f366627a51591c1b96513b60da8" }, "downloads": -1, "filename": "django_pwa_webpush-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "2cb79e877c32dce7962b60b31fb30a44", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 480756, "upload_time": "2019-05-08T19:09:28", "url": "https://files.pythonhosted.org/packages/cd/66/e3ac53d74745eeb8f18e7da344bfd6e66e6ef1ed45ac7389aa6eb839fe1b/django_pwa_webpush-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "704d533441b255e08ba4fb61e10ba90a", "sha256": "b3f37a64c0c8accf32bd67b6700606e7e9dec8b1803c6a5b051516e8025b1977" }, "downloads": -1, "filename": "django-pwa-webpush-1.0.0.tar.gz", "has_sig": false, "md5_digest": "704d533441b255e08ba4fb61e10ba90a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 479902, "upload_time": "2019-05-08T19:09:33", "url": "https://files.pythonhosted.org/packages/79/a1/3e408d7f5690ddec440c8a921895e345290bc670c199d33634f51d9952f3/django-pwa-webpush-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "93857b7a318649a73f82d74ba3787101", "sha256": "553114afb70a9a57f8029ae4fb0c212eb48b95b95319b92e5f1ae66b83d9784a" }, "downloads": -1, "filename": "django_pwa_webpush-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "93857b7a318649a73f82d74ba3787101", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 480930, "upload_time": "2019-09-11T13:53:29", "url": "https://files.pythonhosted.org/packages/e2/27/23f68bbbc391776c1d28da4a664229f0720e33861198223000bee7446e89/django_pwa_webpush-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2e86c4c91f8cd34201175068e76fc740", "sha256": "d44bf6ba2a8351d532d0c7e2da9a208cd49bccae9d7647b7d03d0f9a6e0edd5f" }, "downloads": -1, "filename": "django-pwa-webpush-1.1.0.tar.gz", "has_sig": false, "md5_digest": "2e86c4c91f8cd34201175068e76fc740", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 476778, "upload_time": "2019-09-11T13:53:37", "url": "https://files.pythonhosted.org/packages/9f/e5/032feb0600fef9e97963c53f1eafa257f1121057f139c3450393044fade4/django-pwa-webpush-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "93857b7a318649a73f82d74ba3787101", "sha256": "553114afb70a9a57f8029ae4fb0c212eb48b95b95319b92e5f1ae66b83d9784a" }, "downloads": -1, "filename": "django_pwa_webpush-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "93857b7a318649a73f82d74ba3787101", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 480930, "upload_time": "2019-09-11T13:53:29", "url": "https://files.pythonhosted.org/packages/e2/27/23f68bbbc391776c1d28da4a664229f0720e33861198223000bee7446e89/django_pwa_webpush-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2e86c4c91f8cd34201175068e76fc740", "sha256": "d44bf6ba2a8351d532d0c7e2da9a208cd49bccae9d7647b7d03d0f9a6e0edd5f" }, "downloads": -1, "filename": "django-pwa-webpush-1.1.0.tar.gz", "has_sig": false, "md5_digest": "2e86c4c91f8cd34201175068e76fc740", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 476778, "upload_time": "2019-09-11T13:53:37", "url": "https://files.pythonhosted.org/packages/9f/e5/032feb0600fef9e97963c53f1eafa257f1121057f139c3450393044fade4/django-pwa-webpush-1.1.0.tar.gz" } ] }