I had the same issue, I don’t know yet how to reproduce it and why it’s happening.
But it looks like it’s something related to the new version of Django.
From this comment on the issue it looks like it’s an issue related to .pyc files in the virtual environment.
To fix it this is what I did:
Deleted all the .pyc files in the project with this command:
find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf
Deactivated the virtual environment and reactivate it.
The issue disappeared
I had the same issue and was unable to reliably reproduce it. I tried removing my .pyc files, but still had the same issues. I moved ‘rest_framework’ to the end of my list of INSTALLED_APPS and that seems to be working for me.
- Django – prefetch only the newest record?
- Django – reverse lookups with ManyToManyField
- How can I make SSE with Python (Django)?
- Django template variable value to string literal comparison fails
- Install pil on virtualenv with libjpeg
The error is due to Django Rest Framework, you can check this by removing it and seeing the error disappear.
More specifically, in my case simply removing
from rest_framework.urlpatterns import format_suffix_patterns
from urls.py solved the issue, with Django Rest Framework still installed.
- Django admin: use checkboxes in list view in list_filter()
- Django Admin + Filter Horizontal?
- Django rest framework group based permissions for individual views
- Using Django-taggit with django-rest-framework, i'm not able to save my tags
- How to use forms in django-cms?