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

Fixed Django 2.1 compatibility due to removal of django.contrib.auth.login()/logout() views. #5510

Merged
merged 1 commit into from Oct 18, 2017

Conversation

felixxm
Copy link
Contributor

@felixxm felixxm commented Oct 17, 2017

Fixed Django 2.1 compatibility due to removal of django.contrib.auth.login()/logout() views (see Django documentation 1.11, 2.1).

________________ ERROR collecting tests/test_authentication.py _________________
tests/test_authentication.py:85: in <module>
    url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')),
.tox/py35-djangomaster/lib/python3.5/site-packages/django/urls/conf.py:34: in include
    urlconf_module = import_module(urlconf_module)
.tox/py35-djangomaster/lib/python3.5/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
rest_framework/urls.py:24: in <module>
    url(r'^login/$', views.login, template_name, name='login'),
E   AttributeError: module 'django.contrib.auth.views' has no attribute 'login'

___________________ ERROR collecting tests/test_renderers.py ___________________
tests/test_renderers.py:121: in <module>
    url(r'^api', include('rest_framework.urls', namespace='rest_framework'))
.tox/py35-djangomaster/lib/python3.5/site-packages/django/urls/conf.py:34: in include
    urlconf_module = import_module(urlconf_module)
.tox/py35-djangomaster/lib/python3.5/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
rest_framework/urls.py:24: in <module>
    url(r'^login/$', views.login, template_name, name='login'),
E   AttributeError: module 'django.contrib.auth.views' has no attribute 'login'

___________________ ERROR collecting tests/test_response.py ____________________
tests/test_response.py:131: in <module>
    url(r'^restframework', include('rest_framework.urls', namespace='rest_framework'))
.tox/py35-djangomaster/lib/python3.5/site-packages/django/urls/conf.py:34: in include
    urlconf_module = import_module(urlconf_module)
.tox/py35-djangomaster/lib/python3.5/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
rest_framework/urls.py:24: in <module>
    url(r'^login/$', views.login, template_name, name='login'),
E   AttributeError: module 'django.contrib.auth.views' has no attribute 'login'

@carltongibson
Copy link
Collaborator

carltongibson commented Oct 17, 2017

@felixxm Awesome! I was going to look into that. Thanks! (Will review fully in daylight)

Copy link
Contributor

@auvipy auvipy left a comment

looks good

@rpkilby
Copy link
Member

rpkilby commented Oct 18, 2017

Off hand thought - defer this to December when Django 1.10 is deprecated. That way, the compat check isn't necessary.

@xordoquy
Copy link
Collaborator

xordoquy commented Oct 18, 2017

As was said earlier, we shouldn't drop a django version unless it's too complicated. Seems we're still on track with that change aren't we ?

@carltongibson
Copy link
Collaborator

carltongibson commented Oct 18, 2017

Yep. Let's have this as is for now. All green Travis 🎉 — that's worth the temporary compat check just for the aesthetic benefits over the autumn. 😃

Thanks @felixxm!

@carltongibson carltongibson merged commit 1a526c1 into encode:master Oct 18, 2017
1 check passed
@carltongibson carltongibson added this to the 3.7.2 milestone Oct 18, 2017
@xordoquy
Copy link
Collaborator

xordoquy commented Nov 6, 2017

Unwanted side effect, it may trigger AppRegistryNotReady exceptions in some cases when DRF is imported in the models: it pulls the compat (more often than not) which pulls the authentication views which pull the user model which fails loading as models are not registered yet.

@edmorley
Copy link
Contributor

edmorley commented Nov 6, 2017

Unwanted side effect, it may trigger AppRegistryNotReady exceptions

I've just opened #5564.

@rpkilby
Copy link
Member

rpkilby commented Nov 6, 2017

@edmorley - thanks, we'll continue the discussion over there.

@felixxm felixxm deleted the django-login-compat branch Nov 16, 2017
stanim added a commit to stanim/django-rest-framework that referenced this pull request Sep 4, 2018
I thought DRF is compatible with Django 2.1, see encode#5510
stanim added a commit to stanim/django-rest-framework that referenced this pull request Sep 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants