Background
When I built a Django project which has some PWA features, I found many online resources are outdated, and some are not easy for Django developers to understand.
So I decide to help people with this Django PWA Tutorial Series, it contains 7 blog posts and one open source project on Github.
The source code is available on Github/django-pwa-demo
Objectives
By the end of this course, you will be able to:
- Understand what is
Web app manifestand how to generate app icons using NPM package. - Learn how to use
python-webpack-boilerplateto make Webpack work with Django. - Understand what is
Service Worker, and the life cycle. - Learn to develop
Service WorkerwithWorkboxpackages. - Serve
Service Workerin Django. - Use
Service workerto cache the offline page, and return cached response when network is not available. - Learn how to use
workbox-precachingto precache static assets. - Rewrite the fallback logic with
workbox-routing. - Understand what is
caching strategy - Learn how to make PWA installable.
- Learn the workflow of the
Web Push Notification - Understand what is
VAPIDand how to set it up. - Use
django-push-notificationsto store the subscription info and send push message on server side. - Learn to use
Push APIand handlepushevent in Service worker.
Unlike some people do this with vanilla js, we will benefit from the great frontend ecosystem and write modern JS code to do this.
Tech
- Django
- django-push-notifications
- python-webpack-boilerplate
- workbox-webpack-plugin
Table of content
Django PWA Tutorial Series:
- Introduction
- Add Web app manifest to Django
- Add Service Worker to Django
- Fallback Offline Page in Django
- Caching and Routing (coming soon)
- How to add install button to PWA (coming soon)
- Send Web Push Notification from Django (part 1) (coming soon)
- Send Web Push Notification from Django (part 2) (coming soon)
The source code is available on https://github.com/AccordBox/django-pwa-demo