浙江省高等学校教师教育理论培训

微信搜索“毛凌志岗前心得”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Setting Django/MySQL site to use UTF-8 - Stack Overflow

All I had to do was put this in settings.py:

'OPTIONS': { 'init_command': 'SET storage_engine=INNODB' }

Then I created the database myself in MySQL with:

CREATE DATABASE my_database CHARACTER SET utf8;

followed by all the CREATE USER and GRANT calls.

After that, ./manage.py syncdb and ./manage.py migrate (since I use South) finished everything up.

It's been working fine so far. Didn't have to change any MySQL config files, 

posted on 2012-05-16 16:14  lexus  阅读(299)  评论(0)    收藏  举报