You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed django-cookie-consent on a website and tried to disable the main page on [site-url]/cookies/, but the code stops working. I can not translate it as well.
I suggest we have a logic to allow the website to disable this page, or customize it.
Maybe it is already possible, but I couldn't find anything related in the documentation. If it is, I would appreciate some help.
The text was updated successfully, but these errors were encountered:
For now you can try overriding the URLs yourself or redirect your user somewhere else if they try to access that page. Add URL entries like these to urls.py before including django-cookie-consent urls.
from django.urls import path, re_path
from django.views.generic import TemplateView, RedirectView
urlpatterns = [
# These URLs shadow django-cookie-consent URLs to shut them down:
path('cookies/', RedirectView.as_view(url='/')),
]
I tried this, but the cookie logic stops working. Apparently the lib depends on the site.com/cookies URL being available and sending to the cookies page.
The approach where you manage the URL conf yourself is favourable, as that is just a standard django mechanism and gives you as developer full control when you need it, but indeed, if there's other code that's reversing this URL, then that should be more decoupled.
Do you have a traceback for the situation where "the cookie logic stops working"?
I installed django-cookie-consent on a website and tried to disable the main page on
[site-url]/cookies/
, but the code stops working. I can not translate it as well.I suggest we have a logic to allow the website to disable this page, or customize it.
Maybe it is already possible, but I couldn't find anything related in the documentation. If it is, I would appreciate some help.
The text was updated successfully, but these errors were encountered: