68
loading...
This website collects cookies to deliver better user experience
django-pwa
package from PyPI
$ pip install django-pwa
pwa
to installed apps in Django app settings.
# <proj>/settings.py
INSTALLED_APPS = [
# other installed apps
'pwa',
]
# <proj>/settings.py
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
# or any other location of your choice
]
urls.py
# <proj>/urls.py
from django.urls import path, include
urlpatterns = [
# other path settings
path('', include('pwa.urls')),
]
{% load pwa %}
<head>
<!-- Other head elements -->
{% progressive_web_app_meta %}
</head>
PWA_APP_NAME = 'The analytics club'
PWA_APP_DESCRIPTION = "The analytics club is a blog about data science, software development, and technology"
PWA_APP_THEME_COLOR = '#4669a2 '
PWA_APP_BACKGROUND_COLOR = '#fff'
PWA_APP_DISPLAY = 'standalone'
PWA_APP_SCOPE = '/'
PWA_APP_ORIENTATION = 'any'
PWA_APP_START_URL = '/'
PWA_APP_STATUS_BAR_COLOR = 'default'
PWA_APP_ICONS = [
{
'src': '/static/images/my_app_icon.png',
'sizes': '160x160'
}
]
PWA_APP_ICONS_APPLE = [
{
'src': '/static/images/my_apple_icon.png',
'sizes': '160x160'
}
]
PWA_APP_SPLASH_SCREEN = [
{
'src': '/static/images/icons/splash-640x1136.png',
'media': '(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)'
}
]
PWA_APP_DIR = 'ltr'
PWA_APP_LANG = 'en-US'