pythondjangodjango-cmsdjangocms-text-ckeditor

Django-cms Type error at admin/cms/page/add-plugin?


I have set up an s3 bucket for the media and static files.

Now when I go to edit a page, I can add images, files etc. But when I try to add text I get the following error:

TypeError at /admin/cms/page/add-plugin/
unsupported operand type(s) for +: 'NoneType' and 'str'

Request Method: GET

Request URL:    http://my-url.us-west-2.elasticbeanstalk.com/admin/cms/page/add-plugin/?delete-on-cancel&placeholder_id=23&plugin_type=TextPlugin&cms_path=%2Fblog%2Ftest%2F%3Fedit&language=en&plugin_language=en&plugin=46  

Django Version: 4.2.3

Exception Type: TypeError

Exception Value:    
unsupported operand type(s) for +: 'NoneType' and 'str'

Exception Location: /var/app/venv/staging-LQM1lest/lib64/python3.8/site-packages/ djangocms_text_ckeditor/widgets.py, line 106, in get_ckeditor_settings

Raised during:  cms.admin.placeholderadmin.add_plugin

Python Executable:  /var/app/venv/staging-LQM1lest/bin/python3.8

Python Version: 3.8.16

Python Path:    
['/var/app/current',
 '/var/app/venv/staging-LQM1lest/bin',
 '/var/app/venv/staging-LQM1lest/bin',
 '/usr/lib64/python38.zip',
 '/usr/lib64/python3.8',
 '/usr/lib64/python3.8/lib-dynload',
 '/var/app/venv/staging-LQM1lest/lib64/python3.8/site-packages',
 '/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages']

Error during template rendering
In template /var/app/venv/staging-LQM1lest/lib64/python3.8/site-packages/django/contrib/admin/templates/admin/includes/fieldset.html, error at line 20
unsupported operand type(s) for +: 'NoneType' and 'str'

Line 20: {{ field.field }}

I am not being able to think of any reason for the error other than the storage. Not sure how to proceed.


Solution

  • So line 106 of that widgets.py file does this;

    'static_url': settings.STATIC_URL + 'djangocms_text_ckeditor',
    

    Your error, unsupported operand type(s) for +: 'NoneType' and 'str' therefore tells us that settings.STATIC_URL is None

    Therefore you need to check your settings and verify that STATIC_URL is correctly set.