safwanrahman / django-webpush

Web Push Notification Package for Django
GNU General Public License v3.0
362 stars 103 forks source link

#from django.conf.urls import url #106

Closed abadger1 closed 1 year ago

abadger1 commented 2 years ago

Think you need to remove/comment the top url import line in webpush/urls.py:-

#from django.conf.urls import url
from django.urls import path
from django.views.i18n import JavaScriptCatalog

from django.views.decorators.cache import cache_page
from django.utils import timezone
from . import views

# When we last restarted the server; used for cache control headers and
# invalidating the server side cache on server restart
last_modified_date = timezone.now().strftime("%Y-%m-%d_%H:%M:%S")

urlpatterns = [
    path('jsi18n/',
         cache_page(86400, key_prefix='js18n-%s' % last_modified_date)(
             JavaScriptCatalog.as_view(packages=['webpush'])
         ),
         name='javascript-catalog'),
    path('save_information', views.save_info, name='save_webpush_info'),
    # Service worker need to be loaded from same domain
    path('service-worker.js', views.ServiceWorkerView.as_view(), name='service_worker')
]
javadnikbakht commented 1 year ago

@safwanrahman , you can close this issue manually, it resolved in #107 .