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 4.0 Support #106

Closed
acc248 opened this issue Dec 7, 2021 · 13 comments
Closed

Django 4.0 Support #106

acc248 opened this issue Dec 7, 2021 · 13 comments

Comments

@acc248
Copy link

acc248 commented Dec 7, 2021

Django 4.0 dropped today which removed django.conf.urls.url(). It looks like we're getting an import error here and subsequently here e.g.

ImportError: Could not import 'rest_framework_jwt.authentication.JSONWebTokenAuthentication' for API setting 'DEFAULT_AUTHENTICATION_CLASSES'. ImportError: cannot import name 'url' from 'django.urls' (/usr/local/lib/python3.8/dist-packages/django/urls/__init__.py).

I did a bit of searching through the codebase and it looks like we could switch to re_path or path for this project but I'm not 100% sure. Wanted to file an issue to get the ball rolling on a solution.

@JosephUrciuoli
Copy link

@acc248 I was just writing this up. Having the same issue.

@linuxlewis
Copy link

We're seeing this issue as well. Happy to push up a PR if needed

@andylamp
Copy link

andylamp commented Dec 7, 2021

likewise, we encountered the same issue, eager to get an ETA on when someone can land a PR (that can be swiftly accepted and pushed to pypi)

@acc248
Copy link
Author

acc248 commented Dec 8, 2021

Checked out CONTRIBUTING.md and got the test suite running. I tried to add Django 4.0 to tox.ini and run the tests but getting pytz import errors in drf now. Doesn't look they've cut a release beyond 3.12 but it seems like pytz shouldn't actually be deprecated until Django 5 according to the release notes.

tox -e py39-dj40-drf312 -- --cov=rest_framework_jwt

/Users/acc248/source/django-rest-framework-jwt/.tox/py39-dj40-drf312/lib/python3.9/site-packages/setuptools/config.py:510: DeprecationWarning: The license_file parameter is deprecated, use license_files instead.
  warnings.warn(msg, warning_class)
py39-dj40-drf312 develop-inst-noop: /Users/acc248/source/django-rest-framework-jwt
py39-dj40-drf312 installed: asgiref==3.4.1,attrs==21.2.0,cffi==1.15.0,coverage==6.2,cryptography==3.3.2,Django==4.0,djangorestframework==3.12.4,-e git+https://github.com/Styria-Digital/django-rest-framework-jwt.git@b2d7a8de55583133c8e3a8810071d906b31614e4#egg=drf_jwt,iniconfig==1.1.1,mock==4.0.3,packaging==21.3,pluggy==1.0.0,py==1.11.0,pycparser==2.21,PyJWT==2.3.0,pyparsing==3.0.6,pytest==6.2.5,pytest-cov==3.0.0,pytest-django==4.5.2,pytest-runner==5.3.1,six==1.16.0,sqlparse==0.4.2,toml==0.10.2,tomli==1.2.2
py39-dj40-drf312 run-test-pre: PYTHONHASHSEED='1309023437'
py39-dj40-drf312 run-test: commands[0] | pytest --cov=rest_framework_jwt --cov=rest_framework_jwt
/Users/acc248/source/django-rest-framework-jwt/.tox/py39-dj40-drf312/lib/python3.9/site-packages/django/conf/__init__.py:222: RemovedInDjango50Warning: The USE_L10N setting is deprecated. Starting with Django 5.0, localized formatting of data will always be enabled. For example Django will display numbers and dates using the format of the current locale.
  warnings.warn(USE_L10N_DEPRECATED_MSG, RemovedInDjango50Warning)
/Users/acc248/source/django-rest-framework-jwt/.tox/py39-dj40-drf312/lib/python3.9/site-packages/django/apps/registry.py:91: RemovedInDjango41Warning: 'rest_framework_jwt.blacklist' defines default_app_config = 'rest_framework_jwt.blacklist.apps.BlacklistedTokenConfig'. Django now detects this configuration automatically. You can remove default_app_config.
  app_config = AppConfig.create(entry)
/Users/acc248/source/django-rest-framework-jwt/.tox/py39-dj40-drf312/lib/python3.9/site-packages/django/apps/registry.py:91: RemovedInDjango41Warning: 'app' defines default_app_config = 'app.apps.AppConfig'. Django now detects this configuration automatically. You can remove default_app_config.
  app_config = AppConfig.create(entry)
ImportError while loading conftest '/Users/acc248/source/django-rest-framework-jwt/tests/conftest.py'.
tests/conftest.py:10: in <module>
    from rest_framework.test import APIClient
.tox/py39-dj40-drf312/lib/python3.9/site-packages/rest_framework/test.py:138: in <module>
    class APIRequestFactory(DjangoRequestFactory):
.tox/py39-dj40-drf312/lib/python3.9/site-packages/rest_framework/test.py:139: in APIRequestFactory
    renderer_classes_list = api_settings.TEST_REQUEST_RENDERER_CLASSES
.tox/py39-dj40-drf312/lib/python3.9/site-packages/rest_framework/settings.py:225: in __getattr__
    val = perform_import(val, attr)
.tox/py39-dj40-drf312/lib/python3.9/site-packages/rest_framework/settings.py:168: in perform_import
    return [import_from_string(item, setting_name) for item in val]
.tox/py39-dj40-drf312/lib/python3.9/site-packages/rest_framework/settings.py:168: in <listcomp>
    return [import_from_string(item, setting_name) for item in val]
.tox/py39-dj40-drf312/lib/python3.9/site-packages/rest_framework/settings.py:180: in import_from_string
    raise ImportError(msg)
E   ImportError: Could not import 'rest_framework.renderers.MultiPartRenderer' for API setting 'TEST_REQUEST_RENDERER_CLASSES'. ModuleNotFoundError: No module named 'pytz'.
ERROR: InvocationError for command /Users/acc248/source/django-rest-framework-jwt/.tox/py39-dj40-drf312/bin/pytest --cov=rest_framework_jwt --cov=rest_framework_jwt (exited with code 4)
__________________________________________________ summary ___________________________________________________
ERROR:   py39-dj40-drf312: commands failed

@andylamp
Copy link

nothing still...? any response from a maintainer would be great...

@john-whiting
Copy link

I created a PR for this and have tested it locally. If a maintainer sees this, this fix has been implemented:
#107

@andylamp
Copy link

now it is up to the maintainers to approve this - I cannot find who is directly responsible for this but a tag for them to notice would actually be nice...

@john-whiting
Copy link

I believe @fitodic is the current active maintainer.

@andylamp
Copy link

thanks for the update and also for the tagging, @john-whiting - let's hope we can resolve this soon enough.

@andylamp
Copy link

@fitodic is there any progress regarding this?

@slumtrimpet
Copy link

@fitodic @ajhi @dskalec @igadmile @ntuckovic
Any chance we can get some love here, please? This is becoming a serious roadblock.

@fitodic
Copy link
Collaborator

fitodic commented Jan 8, 2022

Hi, sorry for the delay. I just merged it and released 1.19.2

@fitodic fitodic closed this as completed Jan 8, 2022
@ntuckovic
Copy link

👋 to all!

as, @fitodic commented, he just accepted PR #107

In this occasion I would like to ask you if any of you is interested to join as an active maintainer to this repo?

Let me know so we could add you appropriate user permissions for PR acceptance.

Regards and happy new year to all!

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

8 participants