It seems though if I use the repo directly, everything works fine ( by copying cookie_consent folder from the repo to my django app ).
The code in cookie_consent/util.py which causess the error from the pip package also seems to have changed.
So I suppose this is only an issue with the PyPI package...
MESSAGE: Internal Server Error: /cookies/accept/AnalyticsCookies/
Traceback (most recent call last):
File "/env/lib/python3.7/site-packages/asgiref/sync.py", line 439, in thread_handler
raise exc_info[1]
File "/env/lib/python3.7/site-packages/django/core/handlers/exception.py", line 38, in inner
response = await get_response(request)
File "/env/lib/python3.7/site-packages/django/core/handlers/base.py", line 233, in _get_response_async
response = await wrapped_callback(request, *callback_args, **callback_kwargs)
File "/env/lib/python3.7/site-packages/asgiref/sync.py", line 404, in __call__
ret = await asyncio.wait_for(future, timeout=None)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 414, in wait_for
return await fut
File "/env/lib/python3.7/site-packages/asgiref/current_thread_executor.py", line 22, in run
result = self.fn(*self.args, **self.kwargs)
File "/env/lib/python3.7/site-packages/asgiref/sync.py", line 443, in thread_handler
return func(*args, **kwargs)
File "/env/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/env/lib/python3.7/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/env/lib/python3.7/site-packages/django/views/generic/base.py", line 98, in dispatch
return handler(request, *args, **kwargs)
File "/env/lib/python3.7/site-packages/cookie_consent/views.py", line 54, in post
self.process(request, response, varname)
File "/env/lib/python3.7/site-packages/cookie_consent/views.py", line 64, in process
accept_cookies(request, response, varname)
File "/env/lib/python3.7/site-packages/cookie_consent/util.py", line 97, in accept_cookies
set_cookie_dict_to_response(response, cookie_dic)
File "/env/lib/python3.7/site-packages/cookie_consent/util.py", line 41, in set_cookie_dict_to_response
settings.COOKIE_CONSENT_MAX_AGE)
File "/env/lib/python3.7/site-packages/django/http/response.py", line 203, in set_cookie
self.cookies[key] = value
File "/usr/local/lib/python3.7/http/cookies.py", line 495, in __setitem__
self.__set(key, rval, cval)
File "/usr/local/lib/python3.7/http/cookies.py", line 485, in __set
M.set(key, real_value, coded_value)
File "/usr/local/lib/python3.7/http/cookies.py", line 351, in set
if not _is_legal_key(key):
TypeError: cannot use a string pattern on a bytes-like object
INFO: 172.17.0.1:32962 - "POST /cookies/accept/AnalyticsCookies/ HTTP/1.1" 500 Internal Server Error