2

Python 3.7.3 django version 2.2.1

I've just started learning django and have gone through their polls tutorial.

I'm trying to install django CMS package https://github.com/nephila/djangocms-blog

After running python3 manage.py migrate I'm getting following error:

TypeError: __init__() missing 1 required positional argument: 'on_delete'

I've read the solution suggested on Getting TypeError: __init__() missing 1 required positional argument: 'on_delete' when trying to add parent table after child table with entries but it doesn't resolve

How to fix it?

Following is my models.py

class Choice(models.Model):
question = models.ForeignKey(Question, on_delete=models.CASCADE)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)
def __str__(self):
    return self.choice_text

settings.py

INSTALLED_APPS = [

'django.contrib.sites',

'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',

# CMS Blog
'cms',
'menus',
'filer',
'easy_thumbnails',
'aldryn_apphooks_config',
'cmsplugin_filer_image',
'parler',
'taggit',
'taggit_autosuggest',
'meta',
'sortedm2m',
'djangocms_blog',
]
DaveMS
  • 157
  • 2
  • 13
  • Can you post the full stacktrace please? – Stevy May 21 '19 at 23:46
  • I have the same problem. Python 3.7.2 django 2.1 I can't post the traceback here, but it mentions two lines of cmsplugin_filer_image/models.py – aribo Aug 16 '19 at 23:52

1 Answers1

1

I found the solution.

The CMS Plugin Filer has been deprecated: https://github.com/divio/cmsplugin-filer

It's been left in the installation instructions of Django CMS Blog for legacy, but it should be removed. Explanation here https://github.com/nephila/djangocms-blog/issues/431

The function of this plugin has been replaced by Filer ThumbnailOption, so you can remove this bit

'cmsplugin_filer_image'

from django settings.py> INSTALLED_APPS

It should work then.

Edit: also you will need to install the latest version of djangocms-blog

pip install djangocms-blog==1.0.0rc1
aribo
  • 560
  • 5
  • 7