Note that there are some explanatory texts on larger screens.

plurals
  1. POdjango admin cannot upload files with utf-8 filenames
    text
    copied!<p>Updates: Thanks for Udi's recommendation, i turned on debug and updated the error message plus my model</p> <p>Here is my model:</p> <pre><code>class booktitle(models.Model): added_by = models.ForeignKey(User) book_title_zh = models.CharField(max_length=255) book_desc_zh = models.TextField(blank=True, null=True) author_zh = models.CharField(max_length=255) publisher_zh = models.CharField(max_length=255) category = models.ForeignKey(category) cover_img = models.ImageField(upload_to='books/book_img_cover', blank=True, null=True) last_updated = models.DateField(auto_now=True) date_added = models.DateField(auto_now=True) class Meta: ordering = ('-date_added',) verbose_name = 'Book : 書本' verbose_name_plural = 'Book : 書本' </code></pre> <p>I have a standard django installation. When i use it to upload filename with Chinese Characters, it shows the following error:</p> <blockquote> <p>UnicodeEncodeError at /admin/booksfair/booktitle/6/ 'ascii' codec can't encode characters in position 51-53: ordinal not in range(128) Request Method: POST Request URL: <a href="http://www.mydomain.com/admin/booksfair/booktitle/6/" rel="nofollow">http://www.mydomain.com/admin/booksfair/booktitle/6/</a> Django Version: 1.4 pre-alpha SVN-16395 Exception Type: UnicodeEncodeError Exception Value: 'ascii' codec can't encode characters in position 51-53: ordinal not in range(128) Exception Location: /usr/lib/python2.6/genericpath.py in exists, line 18 Python Executable: /usr/bin/python Python Version: 2.6.7 Python Path:<br> ['/usr/lib/python26.zip', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/site-packages', '/usr/lib/python2.6/site-packages/PIL', '/usr/lib/python2.6/site-packages/gtk-2.0', '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info', '/var/www', '/var/www/html/django/website', '/var/www/html/django']</p> </blockquote> <p>I have found some resolution here, but it doesn't work for my case, this is not a duplicated post. Thank you.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload