Django reusable app, what allows to send web push.
Project description
Push is a Django reusable app, what allows to gather push subscriptions and send web push notifications to browsers (requires SSL-site).
Detailed documentation is in the “docs” directory.
Quick start
pip install django_infopush
Add “push” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'push', ]
Enable sites framework in Django, see official docs.
Configure django_infopush in settings.py (see docs/SETTINGS.rst).
Run python manage.py migrate to create push models.
Include URLconf in your project urls.py like this:
from django.conf import settings from django.views.generic import TemplateView from django.views.decorators.cache import cache_page url(r'^push/', include('push.urls')), url(r'^service-worker.js$', cache_page(1 if settings.DEBUG else 86400)(TemplateView.as_view( template_name="push/service-worker.js", content_type='application/javascript; charset='+settings.DEFAULT_CHARSET, )), name='service-worker.js'),
Add {% include ‘push/_head_include.html’ %} into head-section of your django-project’s html template(s). Do not include it on the pages where you don’t want to see push-subscribe browser window.
Visit http://127.0.0.1:8000/admin/push/ to check everything is working.
CRON setup for pushsend management command (every 5-10 minutes).
(OPTIONAL) Run python manage.py test push for basic check of the app.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.