Hi to all the Django community !
I started with Django.
I have a small form that works pretty well, and that will store the data in a Postgres database, that's fine.
OK, except that when I have a special character to enter (like an accent, I am french), I get an error (No problem without special characters):
'Ascii' codec can not encode character u '\ xe9' in position 0: ordinal not in range (128)
Yet I thought the default Django was utf8...
So I tried to add in settings.py:
LANGUAGE_CODE = 'en-us'
LANG = 'UTF-8'
LC_ALL = 'UTF-8'
DEFAULT_CHARSET = 'utf-8'
But it does not change ...
I notice that if my base postgres is encoded in UTF-8 (when I do a "SHOW SERVER_ENCODING"); the "client" is it in Unicode (when I do a "SHOW CLIENT_ENCODING").
Is it linked?
I also notice that the "local" command at the root of my Django project returns me:
LANG = en_US.UTF-8
LC_CTYPE = "en_US.UTF-8"
LC_NUMERIC = "en_US.UTF-8"
LC_TIME = "en_US.UTF-8"
LC_COLLATE = "en_US.UTF-8"
LC_MONETARY = "en_US.UTF-8"
LC_MESSAGES = "en_US.UTF-8"
LC_PAPER = "en_US.UTF-8"
Lc_name = "en_US.UTF-8"
LC_ADDRESS = "en_US.UTF-8"
LC_TELEPHONE = "en_US.UTF-8"
LC_MEASUREMENT = "en_US.UTF-8"
LC_IDENTIFICATION = "en_US.UTF-8"
LC_ALL =
With "LC_ALL" empty !!! So it is that I did not understand where to put this setting...
How can I force Django to operate only in UTF-8? Or another approach?
THX!