4

While running server I got the following error. I am using Django===1.10.2 and default sqlite3 database as backend. But I got the following exceptions:

python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
Unhandled exception in thread started by <function wrapper at 0x7f56983c3140>
Traceback (most recent call last):
  File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 124, in inner_run
    self.check_migrations()
  File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/core/management/base.py", line 437, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 20, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 52, in __init__
    self.build_graph()
  File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 203, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 65, in applied_migrations
    self.ensure_schema()
  File "/home/nidhinjames/popo/popo/mysite/venv/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in ensure_schema
    raise MigrationSchemaMissing("Unable to create the django_migrations table (%s)" % exc)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf1 in position 6: ordinal not in range(128)

Any solutions can be appreciated????

Felix Gerber
  • 1,615
  • 3
  • 30
  • 40
nidhin
  • 359
  • 1
  • 3
  • 13

1 Answers1

0

It seems that you have set a weird character somewhere, most likely in the name of the sqlite file specified in django settings.

Django dies trying to do raise MigrationSchemaMissing("Unable to create the django_migrations table (%s)" % exc) - when doing this it encounters the UNICODE error which tells that 0xf1 is not part of ASCII. Based on this table this is the character ±. As django will definetly not use this as a table name, i guess it must be related to the filename.

If this is not the case try grep '±' . inside of your project folder to find the usage of this character. HTH

dahrens
  • 3,879
  • 1
  • 20
  • 38