I have installed a vanilla django-cms on a new server. I installed all requirements. It all went fine, up untill the point where I wanted to migrate to the database (Postgres).
So this is what I did :
- Tried reinstalling and installing it all again. Didn't change it.
- Used google to try and find people with the same error.
- Try editing the signals file on which the error(shown below) fires, but that meant rewriting it all, which still made it unresponsive.
Traceback:
File "manage.py", line 22, in <module>
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/websites/fl/flvenv/lib/python3.8/site-packages/django/core/management/_ _init__.py", line 425, in execute_from_command_line
utility.execute()
File "/websites/fl/flvenv/lib/python3.8/site-packages/django/core/management/_ _init__.py", line 401, in execute
django.setup()
File "/websites/fl/flvenv/lib/python3.8/site-packages/django/__init__.py", lin e 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/websites/fl/flvenv/lib/python3.8/site-packages/django/apps/registry.py" , line 114, in populate
app_config.import_models()
File "/websites/fl/flvenv/lib/python3.8/site-packages/django/apps/config.py", line 300, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/websites/fl/flvenv/lib/python3.8/site-packages/cms/models/__init__.py", line 12, in <module>
from cms import signals as s_import # nopyflakes
File "/websites/fl/flvenv/lib/python3.8/site-packages/cms/signals/__init__.py" , line 16, in <module>
page_moved = Signal(providing_args=["instance"])
TypeError: __init__() got an unexpected keyword argument 'providing_args'
Anybody got an idea? Did I miss something. Thanks for your time!
CodePudding user response:
I found that answer to this problem. If you look at the documentation of Django. It has been Django from 2.0 to 3.0.
Do formerly it was :
pizza_done = django.dispatch.Signal(providing_args = ['toppings'])
now it is:
Defining signals
All signals are django.dispatch.Signal instances.
For example:
import django.dispatch
pizza_done = django.dispatch.Signal()
This declares a pizza_done signal.
Source: https://docs.djangoproject.com/en/4.0/topics/signals/
CodePudding user response:
Upgrading django-cors-headers
with python -m pip install -U django-cors-headers
solves this.