[Django] Caractères spéciaux
Bonjours,
Voila je débute sous Django et j'ai un petit problème.
Je suis entrain de créer un site web et j'attaque à la zone d'administration.
Dans mon formulaire quand j'envois un texte qui contients des caractères spéciaux comme 'éàè' il l'envois mais me retourne une erreure.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| UnicodeEncodeError at /admin/CompteRendu/chantier/1/
'ascii' codec can't encode character u'\xe9' in position 1: ordinal not in range(128)
Request Method: GET
Request URL: http://localhost:8000/admin/CompteRendu/chantier/1/
Exception Type: UnicodeEncodeError
Exception Value: 'ascii' codec can't encode character u'\xe9' in position 1: ordinal not in range(128)
Exception Location: C:\Python25\Lib\site-packages\django\utils\encoding.py in force_unicode, line 40
Python Executable: C:\Python25\python.exe
Python Version: 2.5.1
Unicode error hint
The string that could not be encoded/decoded was: Réfecti
Template error
In template c:\python25\lib\site-packages\django\contrib\admin\templates\admin\change_form.html, error at line 14
Caught an exception while rendering: 'ascii' codec can't encode character u'\xe9' in position 1: ordinal not in range(128)
4 <script type="text/javascript" src="../../../jsi18n/"></script>
5 {% for js in javascript_imports %}{% include_admin_script js %}{% endfor %}
6 {% endblock %}
7 {% block stylesheet %}{% admin_media_prefix %}css/forms.css{% endblock %}
8 {% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %}
9 {% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}
10 {% block breadcrumbs %}{% if not is_popup %}
11 <div class="breadcrumbs">
12 <a href="../../../">{% trans "Home" %}</a> ›
13 <a href="../">{{ opts.verbose_name_plural|capfirst|escape }}</a> ›
14 {% if add %}{% trans "Add" %} {{ opts.verbose_name|escape }}{% else %}{{ original|truncatewords:"18"|escape }}{% endif %}
15 </div>
16 {% endif %}{% endblock %}
17 {% block content %}<div id="content-main">
18 {% block object-tools %}
19 {% if change %}{% if not is_popup %}
20 <ul class="object-tools"><li><a href="history/" class="historylink">{% trans "History" %}</a></li>
21 {% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%}
22 </ul>
23 {% endif %}{% endif %}
24 {% endblock %} |
Que dois-je faire pour qu'il accepte ces caractère
Merci d'avance !