Checklist
In testing an application against Django 2.0a1, I ran into a confusing error:
File ".tox/py36-django20/lib/python3.6/site-packages/rest_framework/serializers.py", line 30, in <module>
from rest_framework.compat import JSONField as ModelJSONField
File ".tox/py36-django20/lib/python3.6/site-packages/rest_framework/compat.py", line 26, in <module>
from django.core.urlresolvers import ( # Will be removed in Django 2.0
ModuleNotFoundError: No module named 'django.core.urlresolvers'
After investigating, it is related to a shim for older Django versions which now breaks as of Django 2.0a1:
try:
from django.urls import (
NoReverseMatch, RegexURLPattern, RegexURLResolver, ResolverMatch, Resolver404, get_script_prefix, reverse, reverse_lazy, resolve
)
except ImportError:
from django.core.urlresolvers import ( # Will be removed in Django 2.0
NoReverseMatch, RegexURLPattern, RegexURLResolver, ResolverMatch, Resolver404, get_script_prefix, reverse, reverse_lazy, resolve
)
|
NoReverseMatch, RegexURLPattern, RegexURLResolver, ResolverMatch, Resolver404, get_script_prefix, reverse, reverse_lazy, resolve |
It turns out, RegexURLResolver no longer exists. I would imagine this is related to the new simplified URL patterns.
I'm unsure what the exact fix is at this moment, as I haven't dug into the new url implementation(s) yet, but I do recall that the old regex functionality is being maintained.
Checklist
masterbranch of Django REST framework.In testing an application against Django 2.0a1, I ran into a confusing error:
After investigating, it is related to a shim for older Django versions which now breaks as of Django 2.0a1:
django-rest-framework/rest_framework/compat.py
Line 28 in 607e4ed
It turns out,
RegexURLResolverno longer exists. I would imagine this is related to the new simplified URL patterns.I'm unsure what the exact fix is at this moment, as I haven't dug into the new url implementation(s) yet, but I do recall that the old regex functionality is being maintained.