29👍
If you’re using django and python 2.7 this fixes it for me:
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Utente(models.Model):
see https://docs.djangoproject.com/en/dev/ref/utils/#django.utils.encoding.python_2_unicode_compatible
- Django aggregation: sum then average
- Django: how to change values for nullbooleanfield in a modelform?
- You cannot add messages without installing django.contrib.messages.middleware.MessageMiddleware
6👍
@max4ever ‘s answer works for me.
also sometimes you should put this line in the head of python files:
from __future__ import unicode_literals
it can be helpful when solving unicode encoding issues like this one.
- What is the right way to use angular2 http requests with Django CSRF protection?
- Django: Access request object from admin's form.clean()
- Embed an interactive Bokeh in django views
- Select Children of an Object With ForeignKey in Django?
- How do I create a proper user with django allauth?
4👍
in settings.py add this
import sys
reload(sys)
sys.setdefaultencoding('UTF8')
- Paypal monthly subscription plan settings for first day of the month and making monthly recurring payment – django python
- Python Social Auth Django template example
- Django app in heroku getting worker timeout error
Source:stackexchange.com