I have a new server just installed. Everything seems to be fine but when i run:
python manage.py syncdb
it generates follow error:
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_manager(settings)
File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 351, in handle
return self.handle_noargs(**options)
File "/usr/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 109, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "/usr/lib/python2.6/site-packages/django/core/management/sql.py", line 190, in emit_post_sync_signal
interactive=interactive, db=db)
File "/usr/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/usr/lib/python2.6/site-packages/django/contrib/auth/management/__init__.py", line 51, in create_permissions
content_type=ctype
File "/usr/lib/python2.6/site-packages/django/db/models/manager.py", line 138, in create
return self.get_query_set().create(**kwargs)
File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line 360, in create
obj.save(force_insert=True, using=self.db)
File "/usr/lib/python2.6/site-packages/django/db/models/base.py", line 460, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/usr/lib/python2.6/site-packages/django/db/models/base.py", line 553, in save_base
result = manager._insert(values, return_id=update_pk, using=using)
File "/usr/lib/python2.6/site-packages/django/db/models/manager.py", line 195, in _insert
return insert_query(self.model, values, **kwargs)
File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line 1436, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 791, in execute_sql
cursor = super(SQLInsertCompiler, self).execute_sql(None)
File "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 735, in execute_sql
cursor.execute(sql, params)
File "/usr/lib/python2.6/site-packages/django/db/backends/util.py", line 34, in execute
return self.cursor.execute(sql, params)
File "/usr/lib/python2.6/site-packages/django/db/backends/mysql/base.py", line 86, in execute
return self.cursor.execute(query, args)
File "/usr/lib/python2.6/site-packages/MySQLdb/cursors.py", line 175, in execute
if not self._defer_warnings: self._warning_check()
File "/usr/lib/python2.6/site-packages/MySQLdb/cursors.py", line 89, in _warning_check
warn(w[-1], self.Warning, 3)
_mysql_exceptions.Warning: Incorrect string value: '\xE6\x99\xAF\xE9\xBB\x9E...' for column 'name' at row 1
All the tables and fields, in fact, created automatically without observable problem. I just wanna get rid of this error becoz the same thing does not happen in my old server with exactly the same project running on it.
So I am answering it here so that other people can have answer of same problem:
As said by Bill Kary:
He have solved this himself. Change all the collation of ALL tables AND fields to utf (utf8_general_ci) stops the error beautifully.
Related
I just deleted my localhost database due to export my production website database and then import it to my lcoal db
I used this command to dump db:
./manage.py dumpdata --exclude contenttypes --exclude auth.permission
--exclude sessions --indent 2 > dump.json
and then on my localhost:
./manage.py loaddata dump.json
but I get error:
Traceback (most recent call last):
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 86, in _execute
return self.cursor.execute(sql, params)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/backends/mysql/base.py", line 74, in execute
return self.cursor.execute(query, args)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 209, in execute
res = self._query(query)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 315, in _query
db.query(q)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/MySQLdb/connections.py", line 239, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.IntegrityError: (1062, "Duplicate entry '1' for key 'user_id'")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "./manage.py", line 21, in <module>
main()
File "./manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/core/management/base.py", line 328, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/core/management/base.py", line 369, in execute
output = self.handle(*args, **options)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/core/management/commands/loaddata.py", line 72, in handle
self.loaddata(fixture_labels)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/core/management/commands/loaddata.py", line 114, in loaddata
self.load_label(fixture_label)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/core/management/commands/loaddata.py", line 181, in load_label
obj.save(using=self.using)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/core/serializers/base.py", line 223, in save
models.Model.save_base(self.object, using=using, raw=True, **kwargs)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/models/base.py", line 782, in save_base
updated = self._save_table(
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/models/base.py", line 887, in _save_table
results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/models/base.py", line 924, in _do_insert
return manager._insert(
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/models/query.py", line 1204, in _insert
return query.get_compiler(using=using).execute_sql(returning_fields)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1392, in execute_sql
cursor.execute(sql, params)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 100, in execute
return super().execute(sql, params)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 86, in _execute
return self.cursor.execute(sql, params)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 86, in _execute
return self.cursor.execute(sql, params)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/django/db/backends/mysql/base.py", line 74, in execute
return self.cursor.execute(query, args)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 209, in execute
res = self._query(query)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 315, in _query
db.query(q)
File "/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/venv/lib/python3.8/site-packages/MySQLdb/connections.py", line 239, in query
_mysql.connection.query(self, query)
django.db.utils.IntegrityError: Problem installing fixture '/home/mehdi/python/projects/FollowBotWebsite/v1.2.2/dump.json': Could not load users.Profile(pk=1): (1062, "Duplicate entry '1' for key 'user_id'")
I searched a lot but all soloutions were about permissions or auth, not my own models.
I used signals to make a profile for each user on creation,
solved this problem with addign not raw to my signals:
#receiver(post_save, sender=User)
def create_profile(sender, instance, created, raw=False, **kwargs):
if created and not raw:
Profile.objects.create(user=instance)
print('Profile Created')
I have an existing Django 1.6 application that is using South.
I now need to add the Django admin application to the existing Django app. After adding the relevant admin entries into INSTALLED_APPS when I run syncdb the following error is shown:
django.db.utils.ProgrammingError: (1146, u"Table
'databasename.auth_permission' doesn't exist")
Removing South from the list of installed apps allows syncdb to successfully create the tables.
Is there any way to avoid removing south from the installed apps list just to install the Django Admin tables?
Admin was added by editing settings.py
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'THE ORIGINAL APPS ARE HERE',
'south',
The trackback is:
Syncing...
Creating tables ...
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "path/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "path/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "path/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "path/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "path/lib/python2.7/site-packages/django/core/management/base.py", line 415, in handle
return self.handle_noargs(**options)
File "path/lib/python2.7/site-packages/south/management/commands/syncdb.py", line 92, in handle_noargs
syncdb.Command().execute(**options)
File "path/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "path/lib/python2.7/site-packages/django/core/management/base.py", line 415, in handle
return self.handle_noargs(**options)
File "path/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 112, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "path/lib/python2.7/site-packages/django/core/management/sql.py", line 216, in emit_post_sync_signal
interactive=interactive, db=db)
File "path/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 185, in send
response = receiver(signal=self, sender=sender, **named)
File "path/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py", line 93, in create_permissions
"content_type", "codename"
File "path/lib/python2.7/site-packages/django/db/models/query.py", line 96, in __iter__
self._fetch_all()
File "path/lib/python2.7/site-packages/django/db/models/query.py", line 857, in _fetch_all
self._result_cache = list(self.iterator())
File "path/lib/python2.7/site-packages/django/db/models/query.py", line 1071, in iterator
for row in self.query.get_compiler(self.db).results_iter():
File "path/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 713, in results_iter
for rows in self.execute_sql(MULTI):
File "path/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
cursor.execute(sql, params)
File "path/lib/python2.7/site-packages/django/db/backends/util.py", line 69, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "path/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "path/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "path/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "path/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 124, in execute
return self.cursor.execute(query, args)
File "path/lib/python2.7/site-packages/pymysql/cursors.py", line 102, in execute
result = self._query(query)
File "path/lib/python2.7/site-packages/pymysql/cursors.py", line 202, in _query
conn.query(q)
File "path/lib/python2.7/site-packages/pymysql/connections.py", line 734, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "path/lib/python2.7/site-packages/pymysql/connections.py", line 845, in _read_query_result
result.read()
File "path/lib/python2.7/site-packages/pymysql/connections.py", line 1048, in read
first_packet = self.connection._read_packet()
File "path/lib/python2.7/site-packages/pymysql/connections.py", line 826, in _read_packet
packet.check_error()
File "path/lib/python2.7/site-packages/pymysql/connections.py", line 373, in check_error
raise_mysql_exception(self.__data)
File "path/lib/python2.7/site-packages/pymysql/err.py", line 117, in raise_mysql_exception
_check_mysql_exception(errinfo)
File "path/lib/python2.7/site-packages/pymysql/err.py", line 110, in _check_mysql_exception
raise errorclass(errno,errorvalue)
django.db.utils.ProgrammingError: (1146, u"Table 'databasename.auth_permission' doesn't exist")
I have Mezzanine app and my purpose is to move data from sqlite3 to prostgres.
I found this solution which solved some erors.
But now I have something wrong again and can't understand what actually happend because I got just name of error django.db.utils.DataError.
Here is full Traceback:
manage.py loaddata dump.json
Traceback (most recent call last):
File "D:\GitRepos\newbesturfu\manage.py", line 14, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 338, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 393, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 444, in execute
output = self.handle(*args, **options)
File "C:\Python27\lib\site-packages\django\core\management\commands\loaddata.py", line 60, in handle
self.loaddata(fixture_labels)
File "C:\Python27\lib\site-packages\django\core\management\commands\loaddata.py", line 90, in loaddata
self.load_label(fixture_label)
File "C:\Python27\lib\site-packages\django\core\management\commands\loaddata.py", line 147, in load_label
obj.save(using=self.using)
File "C:\Python27\lib\site-packages\django\core\serializers\base.py", line 173, in save
models.Model.save_base(self.object, using=using, raw=True)
File "C:\Python27\lib\site-packages\django\db\models\base.py", line 738, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "C:\Python27\lib\site-packages\django\db\models\base.py", line 803, in _save_table
forced_update)
File "C:\Python27\lib\site-packages\django\db\models\base.py", line 853, in _do_update
return filtered._update(values) > 0
File "C:\Python27\lib\site-packages\django\db\models\query.py", line 580, in _update
return query.get_compiler(self.db).execute_sql(CURSOR)
File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", line 1062, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", line 840, in execute_sql
cursor.execute(sql, params)
File "C:\Python27\lib\site-packages\django\db\backends\utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "C:\Python27\lib\site-packages\django\db\backends\utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "C:\Python27\lib\site-packages\django\db\utils.py", line 97, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "C:\Python27\lib\site-packages\django\db\backends\utils.py", line 64, in execute
return self.cursor.execute(sql, params)
django.db.utils.DataError
I use Windows 10, Django 1.8.3 and PostgreSQL 9.4.
Does anyone know how to show full error message or may be know how to get rid of this issue?
This is on Microsoft SQL Server 2005.
Python 2.7.
Django 1.4
Django-MSSQL is installed and connecting to the database.
I can read tables, but not insert or update them. Working through django's tutorial on an empty database I get to this point:
# Save the object into the database. You have to call save() explicitly.
>>> p.save()
After save() is called I get this error message (which has also been reported):
Creating tables ...
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 459, in execute_manager
utility.execute()
File "C:\Python26\lib\site-packages\django\core\management\__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python26\lib\site-packages\django\core\management\base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Python26\lib\site-packages\django\core\management\base.py", line 232, in execute
output = self.handle(*args, **options)
File "C:\Python26\lib\site-packages\django\core\management\base.py", line 371, in handle
return self.handle_noargs(**options)
File "C:\Python26\lib\site-packages\django\core\management\commands\syncdb.py", line 110, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "C:\Python26\lib\site-packages\django\core\management\sql.py", line 189, 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 35, in create_permissions
ctype = ContentType.objects.get_for_model(klass)
File "C:\Python26\lib\site-packages\django\contrib\contenttypes\models.py", line 42, in get_for_model
defaults = {'name': smart_unicode(opts.verbose_name_raw)},
File "C:\Python26\lib\site-packages\django\db\models\manager.py", line 134, in get_or_create
return self.get_query_set().get_or_create(**kwargs)
File "C:\Python26\lib\site-packages\django\db\models\query.py", line 449, in get_or_create
obj.save(force_insert=True, using=self.db)
File "C:\Python26\lib\site-packages\django\db\models\base.py", line 463, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "C:\Python26\lib\site-packages\django\db\models\base.py", line 551, in save_base
result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
File "C:\Python26\lib\site-packages\django\db\models\manager.py", line 203, in _insert
return insert_query(self.model, objs, fields, **kwargs)
File "C:\Python26\lib\site-packages\django\db\models\query.py", line 1576, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "C:\Python26\lib\site-packages\django\db\models\sql\compiler.py", line 909, in execute_sql
for sql, params in self.as_sql():
File "C:\Python26\lib\site-packages\django_mssql-1.0.1-py2.6.egg\sqlserver_ado\compiler.py", line 207, in as_sql
sql, params = super(SQLInsertCompiler, self).as_sql(*args, **kwargs)
ValueError: need more than 1 value to unpack
UPDATE: I rolled back to Django 1.3 and this error went away. I suspect it is a change in how Django handles the users and authentication in 1.4. I'll take a look at source when I get a chance and try to patch.
Support for Django 1.4 was added with django-mssql v1.1
pip install django-mssql>=1.1
djnago1.3.1 python2.7.2+ ubuntu 11.10
I am making syncdb, after creating superuser I've got that error:
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (Leave blank to use 'root'): antonio
E-mail address: mr.antonsilin#gmail.com
Password:
Password (again):
Superuser created successfully.
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 351, in handle
return self.handle_noargs(**options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 109, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", line 190, in emit_post_sync_signal
interactive=interactive, db=db)
File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/management/__init__.py", line 30, in create_permissions
ctype = ContentType.objects.get_for_model(klass)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/contenttypes/models.py", line 38, in get_for_model
defaults = {'name': smart_unicode(opts.verbose_name_raw)},
File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 135, in get_or_create
return self.get_query_set().get_or_create(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 385, in get_or_create
obj.save(force_insert=True, using=self.db)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 460, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 553, in save_base
result = manager._insert(values, return_id=update_pk, using=using)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 195, in _insert
return insert_query(self.model, values, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 1436, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 791, in execute_sql
cursor = super(SQLInsertCompiler, self).execute_sql(None)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 735, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 34, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 86, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 176, in execute
if not self._defer_warnings: self._warning_check()
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 92, in _warning_check
warn(w[-1], self.Warning, 3)
_mysql_exceptions.Warning: Incorrect string value: '\xD0\xA0\xD0\xB5\xD0\xB3...' for column 'name' at row 1
please, help =)
That string looks like a utf-8 encoded string. If your database is latin-1 encoded (as mysql often is by default) then that could be the source of your trouble.
Check the character encoding of your database. Here's how.
Also check the default encoding of your python interpreter:
sys.getdefaultencoding()
If this is a brand new database you're working on, it's probably a good idea to have it as utf-8 from the start.
CREATE DATABASE new_db DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci