fusionbox / django-widgy

A CMS framework for Django built on a heterogenous tree editor.
http://wid.gy
Other
333 stars 52 forks source link

Django 1.11: 'module' object has no attribute 'SubfieldBase' #384

Open kdechant opened 7 years ago

kdechant commented 7 years ago

Trying to install widgy on a brand-new site running Django 1.11 and Mezzanine 2.4.3. Got the following error when running 'python manage.py migrate':

Traceback (most recent call last): File "manage.py", line 14, in execute_from_command_line(sys.argv) File "/home/keith/sites/widgy/venv/lib/python3.4/site-packages/django/core/management/init.py", line 363, in execute_from_command_line utility.execute() File "/home/keith/sites/widgy/venv/lib/python3.4/site-packages/django/core/management/init.py", line 337, in execute django.setup() File "/home/keith/sites/widgy/venv/lib/python3.4/site-packages/django/init.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/home/keith/sites/widgy/venv/lib/python3.4/site-packages/django/apps/registry.py", line 108, in populate app_config.import_models() File "/home/keith/sites/widgy/venv/lib/python3.4/site-packages/django/apps/config.py", line 202, in import_models self.models_module = import_module(models_module_name) File "/home/keith/sites/widgy/venv/lib/python3.4/importlib/init.py", line 109, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 2254, in _gcd_import File "", line 2237, in _find_and_load File "", line 2226, in _find_and_load_unlocked File "", line 1200, in _load_unlocked File "", line 1129, in _exec File "", line 1471, in exec_module File "", line 321, in _call_with_frames_removed File "/home/keith/sites/widgy/venv/lib/python3.4/site-packages/widgy/contrib/page_builder/models.py", line 19, in from widgy.contrib.page_builder.db.fields import MarkdownField, VideoField, ImageField File "/home/keith/sites/widgy/venv/lib/python3.4/site-packages/widgy/contrib/page_builder/db/fields.py", line 83, in class VideoField(six.with_metaclass(models.SubfieldBase, models.URLField)): AttributeError: 'module' object has no attribute 'SubfieldBase'

It seems that SubfieldBase was removed in Django 1.10.

lockie commented 7 years ago

Seems to be fixed in #383

febrimaru commented 6 years ago

make test-py DJANGO_SETTINGS_MODULE=tests.settings_contrib py.test Traceback (most recent call last): File "/home/ikondev/.virtualenvs/WidgyBase/bin/py.test", line 11, in sys.exit(main()) File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/_pytest/config/init.py", line 58, in main config = _prepareconfig(args, plugins) File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/_pytest/config/init.py", line 185, in _prepareconfig pluginmanager=pluginmanager, args=args File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/pluggy/hooks.py", line 258, in call return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/pluggy/manager.py", line 67, in _hookexec return self._inner_hookexec(hook, methods, kwargs) File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/pluggy/manager.py", line 61, in firstresult=hook.spec_opts.get('firstresult'), File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/pluggy/callers.py", line 196, in _multicall gen.send(outcome) File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/_pytest/helpconfig.py", line 89, in pytest_cmdline_parse config = outcome.get_result() File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/pluggy/callers.py", line 76, in get_result raise ex[1].with_traceback(ex[2]) File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/pluggy/callers.py", line 180, in _multicall res = hook_impl.function(args) File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/_pytest/config/init.py", line 648, in pytest_cmdline_parse self.parse(args) File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/_pytest/config/init.py", line 820, in parse self._preparse(args, addopts=addopts) File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/_pytest/config/init.py", line 782, in _preparse early_config=self, args=args, parser=self._parser File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/pluggy/hooks.py", line 258, in call return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/pluggy/manager.py", line 67, in _hookexec return self._inner_hookexec(hook, methods, kwargs) File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/pluggy/manager.py", line 61, in firstresult=hook.spec_opts.get('firstresult'), File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/pluggy/callers.py", line 201, in _multicall return outcome.get_result() File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/pluggy/callers.py", line 76, in get_result raise ex[1].with_traceback(ex[2]) File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/pluggy/callers.py", line 180, in _multicall res = hook_impl.function(args) File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/pytest_django/plugin.py", line 267, in pytest_load_initial_conftests _setup_django() File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/pytest_django/plugin.py", line 165, in _setup_django django.setup() File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/django/init.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/django/apps/registry.py", line 108, in populate app_config.import_models() File "/home/ikondev/.virtualenvs/WidgyBase/lib/python3.5/site-packages/django/apps/config.py", line 202, in import_models self.models_module = import_module(models_module_name) File "/usr/lib/python3.5/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 958, in _find_and_load_unlocked File "", line 673, in _load_unlocked File "", line 665, in exec_module File "", line 222, in _call_with_frames_removed File "/home/ikondev/PycharmProjects/WidgyBase/django-widgy-master/widgy/contrib/widgy_mezzanine/models.py", line 16, in from widgy.contrib.page_builder.models import CalloutWidget, Callout File "/home/ikondev/PycharmProjects/WidgyBase/django-widgy-master/widgy/contrib/page_builder/models.py", line 19, in from widgy.contrib.page_builder.db.fields import MarkdownField, VideoField, ImageField File "/home/ikondev/PycharmProjects/WidgyBase/django-widgy-master/widgy/contrib/page_builder/db/fields.py", line 83, in class VideoField(six.with_metaclass(models.SubfieldBase, models.URLField)): AttributeError: module 'django.db.models' has no attribute 'SubfieldBase' Makefile:7: recipe for target 'test-py' failed make: *** [test-py] Error 1

It seems the error is still present

GooseSteps commented 4 years ago

so, how to slove this problem? thanks