Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidTemplateLibrary raised, trying to load 'django_user_agents.templatetags.user_agents' (Django 3.0.7) #41

Open
gregorysemah opened this issue Dec 16, 2020 · 1 comment

Comments

@gregorysemah
Copy link

Hello,

Seems that Django 3.0.7 with python3.9 breaks things

Here is the error
django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'django_user_agents.templatetags.user_agents': cannot import name 'get_and_set_user_agent' from partially initialized module 'django_user_agents.utils' (most likely due to a circular import) (/blablablablablabla/python3.9/site-packages/django_user_agents/utils.py)

The problem appears randomly by restarting runserver (run and debugger with pycharm)

@GeekyShacklebolt
Copy link

Hey,

I have been facing the same issue. with Python3.9.0 and Django3.2.10 (recently updated from 3.2.8). Was getting the error:

File "/.../.venv/lib/python3.9/site-packages/django_user_agents/templatetags/user_agents.py", line 3, in
from ..utils import get_and_set_user_agent
ImportError: cannot import name 'get_and_set_user_agent' from partially initialized module 'django_user_agents.utils' (most likely due to a circular import) (/.../.venv/lib/python3.9/site-packages/django_user_agents/utils.py)

I brought down the Django Version back to 3.2.8 that solves the problem for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@gregorysemah @GeekyShacklebolt and others