AltSchool / dynamic-rest

Dynamic extensions for Django REST Framework
MIT License
820 stars 107 forks source link

Could we add support for Django 4+ #337

Open BuddhiAbeyratneAL opened 2 years ago

BuddhiAbeyratneAL commented 2 years ago

Currently seeing an issue importing this into a project with the latest version of Django Is there a reason why we are pegged to bellow 4.0 ?

AARONJVC commented 1 year ago

Is the issue you are seeing like the following: ImportError: cannot import name 'force_text' from 'django.utils.encoding' encountered in metadata.py?

zmrl010 commented 1 year ago

I was also having trouble when installing this into my django 4.0.4 project using poetry as a package manager. It was failing because this package lists Django <4 and djangorestframework < 3.12.0 in both dynamic_rest/install_requires.txt and dynamic_rest/dynamic_rest.egg-info/requires.txt, which basically means a fail if either of those don't meet those requirements.

I was able to get around this temporarily by simply removing the upper limits before installing in my environment. This is less-than-ideal, but it seems to be working for now. I'll report back if I discover any other issues.

Edit:

...and I quickly ran into the error @AARONJVC mentioned

If I can get my fork working, I'll submit a PR.

JackAtOmenApps commented 1 year ago

Just added PR #339 to add Django 4 support.

monosans commented 1 year ago

Just added PR #339 to add Django 4 support.

When will the new version be available on PyPI? The latest version on PyPI is 2.1.2, with the latest Git tag being 2.1.6.

s-maibuecher commented 10 months ago

Just added PR #339 to add Django 4 support.

When will the new version be available on PyPI? The latest version on PyPI is 2.1.2, with the latest Git tag being 2.1.6.

+1. is there a reason why newer versions are not hosted on PyPI?

esp4ik commented 10 months ago

+1

jamesbraza commented 6 months ago

Would be good to fix this Django deprecation warning in a Django 4 migration:

  /usr/local/lib/python3.10/site-packages/django/apps/registry.py:91: RemovedInDjango41Warning:

  'dynamic_rest' defines default_app_config = 'dynamic_rest.apps.DynamicRestConfig'. Django now detects this configuration automatically. You can remove default_app_config.

This deprecation warning comes from: https://github.com/AltSchool/dynamic-rest/blob/v2.1.3/dynamic_rest/__init__.py#L12

Edit: opened a separate issue https://github.com/AltSchool/dynamic-rest/issues/360 for this

jamesbraza commented 6 months ago

For those asking how to install newer versions, as a workaround until next formal release, you install Git tags like https://github.com/AltSchool/dynamic-rest/releases/tag/v2.1.6 directly from GitHub:

pip install git+https://github.com/AltSchool/dynamic-rest.git@v2.1.6