Closed FrancisBou closed 7 years ago
Python3 utf-8 string vs bytes issue. I was convinced I fixed that issue a few weeks ago. Let me take a look again. Thanks for the report. Stay tuned.
@smirolo It does indeed work in Python2.
So I fixed a few things in the testsite but none that should have an effect on this issue.
On OSX, Python3.6 installed through MacPorts:
$ virtualenv-3.6 ~/workspace
$ cd ~/workspace
$ git clone https://github.com/djaodjin/djaodjin-saas.git
$ cd djaodjin-saas
$ ../bin/pip install -r testsite/requirements.txt
$ ../bin/python ./manage.py migrate --run-syncdb --noinput
$ ../bin/python ./manage.py loaddata testsite/fixtures/test_data.json
$ ../bin/python ./manage.py runserver
No pb...
@FrancisBou: I see you are using Python3.5. I am going to try with that version next. What about Django? Which version are you using? Thank you.
Thanks. @smirolo Using Django 1.11.2
Maybe a bit off topic but what would be the lastest compaptible Django version for this package?
We run Django 1.9.9 in production for a while now. We started with Django 1.7 so my guess is all versions in between are still ok to use. Moving to Django 1.10 proved a little more complex than anticipated - mostly because we have to wait 3rd party dependencies get upgraded.
django.conf.BaseSettings
with django-countries which got fixed after upgrading django-countries to 4.6.1, then manage.py migrate worked.The following commit (5e5b7356) which could be related to your issue has not be part of an official release yet.
Are you running from master on GitHub or the version on Pypi?
@smirolo I was using the package manager. I'll try and downgrade when I get the time, and thanks alot for your detailed input . 👍
Great, that explains it. I will try to make sure all tests pass and push a Python3-compatible version to Pypi this week.
Getting the follwing error using the migrate command.
python ./manage.py migrate --run-syncdb --noinput Running migrations: Applying contenttypes.0001_initial... OK Applying auth.0001_initial... OK Applying admin.0001_initial... OK Applying admin.0002_logentry_remove_auto_add... OK Applying contenttypes.0002_remove_content_type_name... OK Applying auth.0002_alter_permission_name_max_length... OK Applying auth.0003_alter_user_email_max_length... OK Applying auth.0004_alter_user_username_opts... OK Applying auth.0005_alter_user_last_login_null... OK Applying auth.0006_require_contenttypes_0002... OK Applying auth.0007_alter_validators_add_error_messages... OK Applying auth.0008_alter_user_username_max_length... OK Applying saas.0001_initial...Traceback (most recent call last): File "./manage.py", line 22, in
execute_from_command_line(sys.argv)
File "C:\Python35\lib\site-packages\django\core\management__init__.py", line 363, in execute_from_command_line
utility.execute()
File "C:\Python35\lib\site-packages\django\core\management__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python35\lib\site-packages\django\core\management\base.py", line 283, in run_from_argv
self.execute(*args, *cmd_options)
File "C:\Python35\lib\site-packages\django\core\management\base.py", line 330, in execute
output = self.handle(args, options)
File "C:\Python35\lib\site-packages\django\core\management\commands\migrate.py", line 204, in handle
fake_initial=fake_initial,
File "C:\Python35\lib\site-packages\django\db\migrations\executor.py", line 115, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "C:\Python35\lib\site-packages\django\db\migrations\executor.py", line 145, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "C:\Python35\lib\site-packages\django\db\migrations\executor.py", line 244, in apply_migration
state = migration.apply(state, schema_editor)
File "C:\Python35\lib\site-packages\django\db\migrations\migration.py", line 129, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "C:\Python35\lib\site-packages\django\db\migrations\operations\models.py", line 97, in database_forwards
schema_editor.create_model(model)
File "C:\Python35\lib\site-packages\django\db\backends\base\schema.py", line 271, in create_model
self.deferred_sql.append(self._create_fk_sql(model, field, "fk%(totable)s%(to_column)s"))
File "C:\Python35\lib\site-packages\django\db\backends\base\schema.py", line 957, in _create_fk_sql
"name": self.quote_name(self._create_index_name(model, [from_column], suffix=suffix)),
File "C:\Python35\lib\site-packages\django\db\backends\base\schema.py", line 860, in _create_index_name
indexname = '%s%s_%s' % (tablename, ''.join(column_names), hash_suffix_part)
TypeError: sequence item 0: expected str instance, bytes found**