Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kdechant opened this issue Apr 11, 2017 · 3 comments
Open

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

kdechant opened this issue Apr 11, 2017 · 3 comments

Comments

@kdechant
Copy link

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
Copy link

lockie commented Aug 2, 2017

Seems to be fixed in #383

@febrimaru
Copy link

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
Copy link

so, how to slove this problem? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants