Important tips for making world wide application with django.

2007/07/17 13:38

※ 商品のリンクをクリックして何かを購入すると私に少額の報酬が入ることがあります【広告表示】

When make the application that you make the world a target with Django; must be careful by all means.

You must use higher than version 4.1 for MySQL, and of course PostgreSQL is better.

Because the validation for maxlength of Django is performed in character unit, but the column length of version 4.0 of MySQL is calculated by a byte unit. Even if the validation of Django goes, an SQL exception occurs when inserts data in MySQL. Because calculates a column length in character unit after version 4.1 of MySQL, such a problem doesn't occur.

You Must change the character code setting of the database before you do syncdb if you use MySQL. The setting isn't reflected after having inserted data in MySQL. The setting is simple and carries out the following for a MySQL database.

  ALTER DATABASE databasename CHARACTER SET utf8;

Otherwise the thing using a character except the ASCII for like Japanese is garbled and can't put it back.

I took the screen shots that how became.

As a representative of the service that it seemed that a right character code wasn't set for MySQL, I used service called Pownce to make a screen shots. I sent a bug report by various ways, but there isn't a response at all, so I use blog as new way, and there isn't any other intention.

The first piece screen shot is going to do a submitt of a character including the Japanese.

pownce-input

The second piece screen shot is displaying the state that Japanese has been garbled.

pownce-garbled

Such service is never used by a Japanese. Perhaps it isn't used from a Chinese and a Korean, people using Europe and Arabic again either.

And this problem isn't caused by Django, and they don't do right setting in MySQL; is particularly caused.

Of course it isn't the thing that is shameful even if doesn't know it because they don't originally use the character except the ASCII. It is important whether you mind it after having known it.

Prev Entry

Next Entry