diff --git a/app/WYGIWYH/settings.py b/app/WYGIWYH/settings.py index b2eeba1..97b2f9c 100644 --- a/app/WYGIWYH/settings.py +++ b/app/WYGIWYH/settings.py @@ -72,6 +72,7 @@ INSTALLED_APPS = [ "apps.rules.apps.RulesConfig", "apps.calendar_view.apps.CalendarViewConfig", "apps.dca.apps.DcaConfig", + "pwa", ] MIDDLEWARE = [ @@ -335,3 +336,43 @@ else: } CACHALOT_UNCACHABLE_TABLES = ("django_migrations", "procrastinate_jobs") + + +# PWA +PWA_APP_NAME = SITE_TITLE +PWA_APP_DESCRIPTION = "A simple and powerful finance tracker" +PWA_APP_THEME_COLOR = "#fbb700" +PWA_APP_BACKGROUND_COLOR = "#222222" +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/img/favicon/android-icon-192x192.png", "sizes": "192x192"} +] +PWA_APP_ICONS_APPLE = [ + {"src": "/static/img/favicon/apple-icon-180x180.png", "sizes": "180x180"} +] +PWA_APP_SPLASH_SCREEN = [ + { + "src": "/static/img/pwa/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" +PWA_APP_SHORTCUTS = [] +PWA_APP_SCREENSHOTS = [ + { + "src": "/static/img/pwa/splash-750x1334.png", + "sizes": "750x1334", + "type": "image/png", + "form_factor": "wide", + }, + { + "src": "/static/img/pwa/splash-750x1334.png", + "sizes": "750x1334", + "type": "image/png", + }, +] diff --git a/app/WYGIWYH/urls.py b/app/WYGIWYH/urls.py index 5a465a5..7aed790 100644 --- a/app/WYGIWYH/urls.py +++ b/app/WYGIWYH/urls.py @@ -27,6 +27,7 @@ urlpatterns = [ path("hijack/", include("hijack.urls")), path("__debug__/", include("debug_toolbar.urls")), path("__reload__/", include("django_browser_reload.urls")), + path("", include("pwa.urls")), # path("api/", include("rest_framework.urls")), path("api/", include("apps.api.urls")), path("api/schema/", SpectacularAPIView.as_view(), name="schema"), diff --git a/app/static/img/favicon/manifest.json b/app/static/img/favicon/manifest.json deleted file mode 100644 index 9d5c19d..0000000 --- a/app/static/img/favicon/manifest.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "WYGIWYH", - "icons": [ - { - "src": "\/static\/img\/favicon\/android-icon-36x36.png", - "sizes": "36x36", - "type": "image\/png", - "density": "0.75" - }, - { - "src": "\/static\/img\/favicon\/android-icon-48x48.png", - "sizes": "48x48", - "type": "image\/png", - "density": "1.0" - }, - { - "src": "\/static\/img\/favicon\/android-icon-72x72.png", - "sizes": "72x72", - "type": "image\/png", - "density": "1.5" - }, - { - "src": "\/static\/img\/favicon\/android-icon-96x96.png", - "sizes": "96x96", - "type": "image\/png", - "density": "2.0" - }, - { - "src": "\/static\/img\/favicon\/android-icon-144x144.png", - "sizes": "144x144", - "type": "image\/png", - "density": "3.0" - }, - { - "src": "\/static\/img\/favicon\/android-icon-192x192.png", - "sizes": "192x192", - "type": "image\/png", - "density": "4.0" - } - ] -} diff --git a/app/static/img/pwa/splash-640x1136.png b/app/static/img/pwa/splash-640x1136.png new file mode 100644 index 0000000..8f5db6b Binary files /dev/null and b/app/static/img/pwa/splash-640x1136.png differ diff --git a/app/static/img/pwa/splash-750x1334.png b/app/static/img/pwa/splash-750x1334.png new file mode 100644 index 0000000..93098b3 Binary files /dev/null and b/app/static/img/pwa/splash-750x1334.png differ diff --git a/app/templates/includes/head/favicons.html b/app/templates/includes/head/favicons.html index 52a872b..458ad45 100644 --- a/app/templates/includes/head/favicons.html +++ b/app/templates/includes/head/favicons.html @@ -12,7 +12,6 @@ - - \ No newline at end of file + diff --git a/app/templates/layouts/base.html b/app/templates/layouts/base.html index b55ceba..6545aa9 100644 --- a/app/templates/layouts/base.html +++ b/app/templates/layouts/base.html @@ -1,3 +1,4 @@ +{% load pwa %} {% load formats %} {% load i18n %} {% load title %} @@ -15,6 +16,7 @@ {% include 'includes/head/favicons.html' %} + {% progressive_web_app_meta %} {% include 'includes/styles.html' %} {% block extra_styles %}{% endblock %} diff --git a/app/templates/layouts/base_auth.html b/app/templates/layouts/base_auth.html index c38d0d3..6cd9a16 100644 --- a/app/templates/layouts/base_auth.html +++ b/app/templates/layouts/base_auth.html @@ -1,3 +1,4 @@ +{% load pwa %} {% load title %} {% load webpack_loader %} @@ -11,8 +12,9 @@ {% endblock title %} {% endfilter %} - + {% include 'includes/head/favicons.html' %} + {% progressive_web_app_meta %} {% include 'includes/styles.html' %} {% block extra_styles %}{% endblock %} diff --git a/requirements.txt b/requirements.txt index b4e4f02..808f347 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ django-filter==24.3 django-debug-toolbar==4.3.0 django-cachalot~=2.6.3 django-cotton~=1.2.1 - +django-pwa~=2.0.1 djangorestframework~=3.15.2 drf-spectacular~=0.27.2