I\'ve models.py
as follows,
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_
-
I faced the same issue when I upgrade the Django version 2.x to 3.0. This issue, I faced due to auditlog library.
First, execute the below command
pip uninstall auditlog
then
pip install auditlog3
讨论(0)
-
try
from django.utils.six import python_2_unicode_compatible
instead of
from django.utils.encoding import python_2_unicode_compatible
this works well for me in Django 1.10.6
讨论(0)
-
I ran into this issue when I wanted to use Django for Graphite.
Turns out I had Django 1.3 installed and my Graphite version was breaking with Django > 1.5, so installing the latest version of the 1.4 branch fixed the problem:
sudo pip install --upgrade 'Django<1.5'
讨论(0)
-
For the latest Django 3.0.4 , and auditlog try
from six import python_2_unicode_compatible
instead of
from django.utils.six import python_2_unicode_compatible
if it is not install run the below code
pip install six
讨论(0)
-
python_2_unicode_compatible
feature has only been added in Django 1.5 version.
https://docs.djangoproject.com/en/dev/ref/utils/#django.utils.encoding.python_2_unicode_compatible
讨论(0)
-
It's actually also present in the 1.4 series since 1.4.2. You should really be using the latest 1.4.X release (1.4.10 as of the time of this writing) as earlier versions have known security vulnerabilities.
讨论(0)
- 热议问题