Skip to main content

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

  1. pip install django_infopush

  2. Add “push” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'push',
    ]
  3. Enable sites framework in Django, see official docs.

  4. Configure django_infopush in settings.py (see docs/SETTINGS.rst).

  5. Run python manage.py migrate to create push models.

  6. 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'),
  7. 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.

  8. Visit http://127.0.0.1:8000/admin/push/ to check everything is working.

  9. CRON setup for pushsend management command (every 5-10 minutes).

  10. (OPTIONAL) Run python manage.py test push for basic check of the app.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_infopush-1.6.5.tar.gz (298.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page