2
votes

Hi i'm trying to upgrade to wagtail 2.0. I have dealt with a series of errors but I can't get past this one which occurs on migration:

  File "/Users/tim/wagtailcmsdemo/home/migrations/0001_initial.py", line 17, in Migration
    ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
TypeError: __init__() missing 1 required positional argument: 'on_delete'

Any help greatly appreciated

Thanks

Tim

Full console error:

(wagtail-isa) MacBook-Air:wagtailcmsdemo tim$ ./manage.py makemigrations Traceback (most recent call last): File "./manage.py", line 10, in execute_from_command_line(sys.argv) File "/Users/tim/Virtualenvs/wagtail-isa/lib/python3.6/site-packages/django/core/management/init.py", line 371, in execute_from_command_line utility.execute() File "/Users/tim/Virtualenvs/wagtail-isa/lib/python3.6/site-packages/django/core/management/init.py", line 365, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Users/tim/Virtualenvs/wagtail-isa/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv self.execute(*args, **cmd_options) File "/Users/tim/Virtualenvs/wagtail-isa/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute output = self.handle(*args, **options) File "/Users/tim/Virtualenvs/wagtail-isa/lib/python3.6/site-packages/django/core/management/commands/makemigrations.py", line 78, in handle loader = MigrationLoader(None, ignore_no_migrations=True) File "/Users/tim/Virtualenvs/wagtail-isa/lib/python3.6/site-packages/django/db/migrations/loader.py", line 49, in init self.build_graph() File "/Users/tim/Virtualenvs/wagtail-isa/lib/python3.6/site-packages/django/db/migrations/loader.py", line 200, in build_graph self.load_disk() File "/Users/tim/Virtualenvs/wagtail-isa/lib/python3.6/site-packages/django/db/migrations/loader.py", line 109, in load_disk migration_module = import_module("%s.%s" % (module_name, migration_name)) File "/Users/tim/Virtualenvs/wagtail-isa/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 978, in _gcd_import File "", line 961, in _find_and_load File "", line 950, in _find_and_load_unlocked File "", line 655, in _load_unlocked
File "", line 678, in exec_module File "", line 205, in _call_with_frames_removed File "/Users/tim/wagtailcmsdemo/home/migrations/0001_initial.py", line 7, in class Migration(migrations.Migration): File "/Users/tim/wagtailcmsdemo/home/migrations/0001_initial.py", line 17, in Migration ('page_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wagtailcore.Page')), TypeError: init() missing 1 required positional argument: 'on_delete'

1

1 Answers

2
votes

by docs of wagtail v2.0.1 compatibility

Wagtail supports Django 1.11.x and 2.0 on Python 3.4, 3.5 and 3.6. Supported database backends are PostgreSQL, MySQL and SQLite.

but you try to use Django >= 1.11 and by doc django ForeignKey for version 1.11

(on_delete isn’t actually required, but not providing it gives a deprecation warning. It will be required in Django 2.0.)