ImportError: cannot import name 'is_authenticated' with Django REST Framework 3.7.x #1283

Closed
opened 2025-12-29 16:31:04 +01:00 by adam · 4 comments
Owner

Originally created by @jeremystretch on GitHub (Oct 6, 2017).

Issue type

[ ] Feature request
[x] Bug report
[ ] Documentation

Environment

  • Python version: 3.4.3
  • NetBox version: 2.1.5

Description

Django REST Framework 3.7.0 was released today. This release removes compatibility code (originally added to support out-of-date Django versions) which we are using in one of the utility classes.

Workaround

Install a DRF release prior to 3.7.0:

pip3 install djangorestframework==3.6.4
Originally created by @jeremystretch on GitHub (Oct 6, 2017). ### Issue type [ ] Feature request <!-- Requesting the implementation of a new feature --> [x] Bug report <!-- Reporting unexpected or erroneous behavior --> [ ] Documentation <!-- Proposing a modification to the documentation --> ### Environment * Python version: 3.4.3 * NetBox version: 2.1.5 ### Description Django REST Framework 3.7.0 was released today. This release [removes compatibility code ](https://github.com/encode/django-rest-framework/pull/5481) (originally added to support out-of-date Django versions) which we are using in one of the utility classes. ### Workaround Install a DRF release prior to 3.7.0: ``` pip3 install djangorestframework==3.6.4 ```
adam added the type: bug label 2025-12-29 16:31:04 +01:00
adam closed this issue 2025-12-29 16:31:04 +01:00
Author
Owner

@dirtycajunrice commented on GitHub (Oct 6, 2017):

posted an hour before i could. This workaround does not apply to the beta 2.2 release. Installing and then reverting the framework is fine on 2.1.5. Causes a "reported to administrator error" on beta2

@dirtycajunrice commented on GitHub (Oct 6, 2017): posted an hour before i could. This workaround does not apply to the beta 2.2 release. Installing and then reverting the framework is fine on 2.1.5. Causes a "reported to administrator error" on beta2
Author
Owner

@jeremystretch commented on GitHub (Oct 6, 2017):

@DirtyCajunRice I have no issue running v2.2-beta2 with DRF 3.6.4. What is the error being reported?

@jeremystretch commented on GitHub (Oct 6, 2017): @DirtyCajunRice I have no issue running v2.2-beta2 with DRF 3.6.4. What is the error being reported?
Author
Owner

@dirtycajunrice commented on GitHub (Oct 6, 2017):

@jeremystretch
Error:
image

That reads like the ./upgrade.sh is not adding the postgres table if im not mistaken

@dirtycajunrice commented on GitHub (Oct 6, 2017): @jeremystretch Error: ![image](https://user-images.githubusercontent.com/15788890/31297742-d85a1b4e-aaac-11e7-9e41-210c233a9bf8.png) That reads like the ./upgrade.sh is not adding the postgres table if im not mistaken
Author
Owner

@dirtycajunrice commented on GitHub (Oct 6, 2017):

Fixed it by forcing requirements.txt to djangorestframework==3.6.4

Seems that once the error occurs with 3.7.0 it does not run migrations.

@dirtycajunrice commented on GitHub (Oct 6, 2017): Fixed it by forcing requirements.txt to djangorestframework==3.6.4 Seems that once the error occurs with 3.7.0 it does not run migrations.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1283