8👍
Short answer: you might want to abandon django-jsonfield
.
Based on the traceback, you are using the django-jsonfield
package [GitHub], and this is a known issue [GitHub-issue]. It depends on the django.utils.six
module, but that module has been removed in django-3.0.
At the moment, you thus can not use django-3.0 with django-jsonfield, and since the last commit to this project is from October 2017, perhaps the project is not that “active” anymore, and it thus might take a very long time (or even never) get fixed. The successor of django-jsonfield is jsonfield2 ([GitHub]). It was made compatible with django-3.0 by a pull request in October (2019) [GitHub-pr].
7👍
in order to use the six module you can install it directly using pip and then modify the django-jsonfield package accordingly . What I mean is find the files in the package where there is from django.utils import six
and replace them with import six
. Then it should be working. I faced the same issue when using djongo with django 3.0. I found the respective file and replaced it with the above suggestion. Please note that it is never recommended to do this if you are working on a production level or enterprise level project. I did it for my pet project.
- Global name 'reverse' is not defined
- How to output text from database with line breaks in a django template?
3👍
A specified in Django 3.0 release note, django.utils.six
is removed.
In case you need it, it is advised to use pypi packages instead
In your case, jsonfield
package might be replaced by native Django’s JSON Field.
Another solution would be to fork jsonfield
package yourself to solve you issue, or to make a PR on project’s repo’
0👍
Short Answer
in Django 3.0 just install six:
pip install six
And just use it like:
import six
- Customizing django admin ChangeForm template / adding custom content
- Django Rest Framework – Post Foreign Key
- How to get a name of last migration programmatically?
- How to nginx virtual servers + fcgi for django?
0👍
In my case it was django-haystac causing this error.
It helped me to upgrade the pip package to the newest beta.
pip install django-haystack==3.0b2
- Is there a Django template tag that lets me set a context variable?
- What is the proper way of testing throttling in DRF?
- Where to instantiate boto s3 client so it is reused during a request?
- X-editable inline editing in Django – how to get CSRF protection?