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
So this is a bit of a weird issue. I have been using django-openinghours in a project for a while and not having any issues, and today I was working on integrating https://github.com/Koed00/django-q into the project.
For some reason, django-openinghours and django-q are not compatible with each other, and as soon as I add django_q to my INSTALLED_APPS in my project's settings.py, I get the following error when trying to load any page in the Django Admin:
Traceback:
File "/Users/jordan/Development/my_project/venv/lib/python3.5/site-packages/django/template/utils.py" in __getitem__
65. return self._engines[alias]
During handling of the above exception ('django'), another exception occurred:
File "/Users/jordan/Development/my_project/venv/lib/python3.5/site-packages/django/template/backends/django.py" in get_package_libraries
126. module = import_module(entry[1])
File "/Users/jordan/Development/my_project/venv/lib/python3.5/importlib/__init__.py" in import_module
126. return _bootstrap._gcd_import(name[level:], package, level)
File "/Users/jordan/Development/my_project/venv/lib/python3.5/site-packages/openinghours/templatetags/openinghours_tags.py" in <module>
6. from openinghours import utils
File "/Users/jordan/Development/my_project/venv/lib/python3.5/site-packages/openinghours/utils.py" in <module>
9. from compat import get_model
Exception Type: InvalidTemplateLibrary at /admin/login/
Exception Value: Invalid template library specified. ImportError raised when trying to load 'openinghours.templatetags.openinghours_tags': cannot import name 'get_model'
If I remove django_q from my INSTALLED_APPS, the error goes away and everything works fine again, but then I can't use django-q obviously, so I've managed to find another solution. If I update the django-openinghours code to use get_model() from django.apps instead of get_model() from compat, I no longer get this InvalidTemplateLibrary exception and both django-openinghours and django-q work correctly. I have created a fork of django-openinghours which has this fix, which you can see at jordanmkoncz@4e23d45. Note that this fork was done from the v0.1.3 commit, as this is the version currently published to PyPI and the one I have been using in my project.
The text was updated successfully, but these errors were encountered:
So this is a bit of a weird issue. I have been using
django-openinghours
in a project for a while and not having any issues, and today I was working on integrating https://github.com/Koed00/django-q into the project.For some reason,
django-openinghours
anddjango-q
are not compatible with each other, and as soon as I adddjango_q
to myINSTALLED_APPS
in my project'ssettings.py
, I get the following error when trying to load any page in the Django Admin:If I remove
django_q
from myINSTALLED_APPS
, the error goes away and everything works fine again, but then I can't usedjango-q
obviously, so I've managed to find another solution. If I update thedjango-openinghours
code to useget_model()
fromdjango.apps
instead ofget_model()
fromcompat
, I no longer get thisInvalidTemplateLibrary
exception and bothdjango-openinghours
anddjango-q
work correctly. I have created a fork ofdjango-openinghours
which has this fix, which you can see at jordanmkoncz@4e23d45. Note that this fork was done from the v0.1.3 commit, as this is the version currently published to PyPI and the one I have been using in my project.The text was updated successfully, but these errors were encountered: