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

Django 5.0b1 incompatibility #36

Closed
jaddison opened this issue Oct 31, 2023 · 0 comments · Fixed by #37
Closed

Django 5.0b1 incompatibility #36

jaddison opened this issue Oct 31, 2023 · 0 comments · Fixed by #37

Comments

@jaddison
Copy link

  File "/Users/jaddison/projects/myproj/api/project/views/urls.py", line 7, in <module>
    from project.views.api.urls import api
  File "/Users/jaddison/projects/myproj/api/project/views/api/urls.py", line 6, in <module>
    from ninja_jwt.authentication import AsyncJWTAuth
  File "/Users/jaddison/projects/myproj/api/venv/lib/python3.11/site-packages/ninja_jwt/authentication.py", line 12, in <module>
    from .tokens import Token
  File "/Users/jaddison/projects/myproj/api/venv/lib/python3.11/site-packages/ninja_jwt/tokens.py", line 13, in <module>
    from .utils import aware_utcnow, datetime_from_epoch, datetime_to_epoch, format_lazy
  File "/Users/jaddison/projects/myproj/api/venv/lib/python3.11/site-packages/ninja_jwt/utils.py", line 9, in <module>
    from django.utils.timezone import is_naive, make_aware, utc
ImportError: cannot import name 'utc' from 'django.utils.timezone' (/Users/jaddison/projects/myproj/api/venv/lib/python3.11/site-packages/django/utils/timezone.py)

From Django 4.1's release deprecation notes:

The django.utils.timezone.utc alias to datetime.timezone.utc is deprecated. Use datetime.timezone.utc directly.

From Django 5.0's release notes:

The django.utils.timezone.utc alias to datetime.timezone.utc is removed.

jaddison pushed a commit to jaddison/django-ninja-jwt that referenced this issue Oct 31, 2023
eadwinCode pushed a commit that referenced this issue Nov 2, 2023
…ixes #36. (#37)

Co-authored-by: James Addison <james.addison@certn.co>
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

Successfully merging a pull request may close this issue.

1 participant