python - Django SYNCDB failes when adding super-user (Windows 7, mySQL, Django 1.2.4, mySQL 5.5) -
syncdb fails when creating super user
django: v 1.2.4 python: 2.6 mysql server: 5.5 windows 7 extra: mysql-python v1.2.3
what steps reproduce problem? 1. install above programs 2. create project 3. run syncdb
note: have installed mysql support utf 8. create mysite_db database using create dtabase mysite_db character set = utf8;
what expected output? see instead?
syncdb create required tables follows:
c:\djangoprojects\mysite>python manage.py syncdb creating table auth_permission creating table auth_group_permissions creating table auth_group creating table auth_user_user_permissions creating table auth_user_groups creating table auth_user creating table auth_message creating table django_content_type creating table django_session creating table django_site installed django's auth system, means don't have superuse rs defined. create 1 now? (yes/no):
i select 'yes' , following error:
traceback (most recent call last): file "manage.py", line 11, in <module> execute_manager(settings) file "c:\python26\lib\site-packages\django\core\management\__init__.py", line 438, in execute_manager utility.execute() file "c:\python26\lib\site-packages\django\core\management\__init__.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) file "c:\python26\lib\site-packages\django\core\management\base.py", line 191, in run_from_argv self.execute(*args, **options.__dict__) file "c:\python26\lib\site-packages\django\core\management\base.py", line 220, in execute output = self.handle(*args, **options) file "c:\python26\lib\site-packages\django\core\management\base.py", line 351, in handle return self.handle_noargs(**options) file "c:\python26\lib\site-packages\django\core\management\commands\syncdb.py" , line 103, in handle_noargs emit_post_sync_signal(created_models, verbosity, interactive, db) file "c:\python26\lib\site-packages\django\core\management\sql.py", line 182, in emit_post_sync_signal interactive=interactive, db=db) file "c:\python26\lib\site-packages\django\dispatch\dispatcher.py", line 172, in send response = receiver(signal=self, sender=sender, **named) file "c:\python26\lib\site-packages\django\contrib\auth\management\__init__.py ", line 44, in create_superuser call_command("createsuperuser", interactive=true) file "c:\python26\lib\site-packages\django\core\management\__init__.py", line 166, in call_command return klass.execute(*args, **defaults) file "c:\python26\lib\site-packages\django\core\management\base.py", line 220, in execute output = self.handle(*args, **options) file "c:\python26\lib\site-packages\django\contrib\auth\management\commands\cr eatesuperuser.py", line 71, in handle user.objects.get(username=default_username) file "c:\python26\lib\site-packages\django\db\models\manager.py", line 132, in return self.get_query_set().get(*args, **kwargs) file "c:\python26\lib\site-packages\django\db\models\query.py", line 342, in g et num = len(clone) file "c:\python26\lib\site-packages\django\db\models\query.py", line 80, in __ len__ self._result_cache = list(self.iterator()) file "c:\python26\lib\site-packages\django\db\models\query.py", line 271, in terator row in compiler.results_iter(): file "c:\python26\lib\site-packages\django\db\models\sql\compiler.py", line 67 7, in results_iter rows in self.execute_sql(multi): file "c:\python26\lib\site-packages\django\db\models\sql\compiler.py", line 73 2, in execute_sql cursor.execute(sql, params) file "c:\python26\lib\site-packages\django\db\backends\util.py", line 15, in e xecute return self.cursor.execute(sql, params) file "c:\python26\lib\site-packages\django\db\backends\mysql\base.py", line 86 , in execute return self.cursor.execute(query, args) file "c:\python26\lib\site-packages\mysqldb\cursors.py", line 175, in execute if not self._defer_warnings: self._warning_check() file "c:\python26\lib\site-packages\mysqldb\cursors.py", line 89, in _warning_ check warn(w[-1], self.warning, 3) _mysql_exceptions.warning: incorrect string value: '\xed' column 'username' @ row 1
what version of product using? on operating system?
django: v 1.2.4 python: 2.6 mysql server: 5.5 windows 7 extra: mysql-python v1.2.3
please provide additional information below.
i have mysql c++ , odbc database connectors installed. appreciated.
looks have unicode characters somewhere in models.py or fixture. convert files utf-8 , add comment first line:
#coding-utf-8
also, before unicode strings add u
, this:
name = charfield(maxlength=255, default=u"утф-8 строка");
Comments
Post a Comment