I am upgrading to django 1.9 (from 1.6)
mysql-connector-python 2.1.6 is installed
when I try to run my app, I get:
TypeError: Error when calling the metaclass bases
'NoneType' object is not callable
Has anyone had this issue?
stacktrace:
/Library/Python/2.7/site-packages/django/core/handlers/wsgi.pyc in __init__(self, *args, **kwargs)
149 def __init__(self, *args, **kwargs):
150 super(WSGIHandler, self).__init__(*args, **kwargs)
--> 151 self.load_middleware()
152
153 def __call__(self, environ, start_response):
/Library/Python/2.7/site-packages/django/core/handlers/base.pyc in load_middleware(self)
55 for middleware_path in settings.MIDDLEWARE_CLASSES:
56 print middleware_path
---> 57 mw_class = import_string(middleware_path)
58 try:
59 mw_instance = mw_class()
/Library/Python/2.7/site-packages/django/utils/module_loading.pyc in import_string(dotted_path)
18 six.reraise(ImportError, ImportError(msg), sys.exc_info()[2])
19
---> 20 module = import_module(module_path)
21
22 try:
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.pyc in import_module(name, package)
35 level += 1
36 name = _resolve_name(name[level:], package, level)
---> 37 __import__(name)
38 return sys.modules[name]
/Library/Python/2.7/site-packages/django/contrib/auth/middleware.py in <module>()
2 from django.contrib import auth
3 from django.contrib.auth import load_backend
----> 4 from django.contrib.auth.backends import RemoteUserBackend
5 from django.core.exceptions import ImproperlyConfigured
6 from django.utils.deprecation import MiddlewareMixin
/Library/Python/2.7/site-packages/django/contrib/auth/backends.py in <module>()
2
3 from django.contrib.auth import get_user_model
----> 4 from django.contrib.auth.models import Permission
5
6 UserModel = get_user_model()
/Library/Python/2.7/site-packages/django/contrib/auth/models.py in <module>()
2
3 from django.contrib import auth
----> 4 from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
5 from django.contrib.auth.signals import user_logged_in
6 from django.contrib.contenttypes.models import ContentType
/Library/Python/2.7/site-packages/django/contrib/auth/base_user.py in <module>()
50
51 @python_2_unicode_compatible
---> 52 class AbstractBaseUser(models.Model):
53 password = models.CharField(_('password'), max_length=128)
54 last_login = models.DateTimeField(_('last login'), blank=True, null=True)
/Library/Python/2.7/site-packages/django/db/models/base.pyc in __new__(cls, name, bases, attrs)
122 app_label = app_config.label
123
--> 124 new_class.add_to_class('_meta', Options(meta, app_label))
125 if not abstract:
126 new_class.add_to_class(
/Library/Python/2.7/site-packages/django/db/models/base.pyc in add_to_class(cls, name, value)
328 # We should call the contribute_to_class method only if it's bound
329 if not inspect.isclass(value) and hasattr(value, 'contribute_to_class'):
--> 330 value.contribute_to_class(cls, name)
331 else:
332 setattr(cls, name, value)
/Library/Python/2.7/site-packages/django/db/models/options.pyc in contribute_to_class(self, cls, name)
212 if not self.db_table:
213 self.db_table = "%s_%s" % (self.app_label, self.model_name)
--> 214 self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
215
216 def _prepare(self, model):
/Library/Python/2.7/site-packages/django/db/__init__.pyc in __getattr__(self, item)
31 """
32 def __getattr__(self, item):
---> 33 return getattr(connections[DEFAULT_DB_ALIAS], item)
34
35 def __setattr__(self, name, value):
/Library/Python/2.7/site-packages/django/db/utils.pyc in __getitem__(self, alias)
210 db = self.databases[alias]
211 backend = load_backend(db['ENGINE'])
--> 212 conn = backend.DatabaseWrapper(db, alias)
213 setattr(self._connections, alias, conn)
214 return conn
/Library/Python/2.7/site-packages/mysql/connector/django/base.pyc in __init__(self, *args, **kwargs)
334
335 def __init__(self, *args, **kwargs):
--> 336 super(DatabaseWrapper, self).__init__(*args, **kwargs)
337
338 try:
/Library/Python/2.7/site-packages/django/db/backends/base/base.pyc in __init__(self, settings_dict, alias, allow_thread_sharing)
94 self.run_commit_hooks_on_set_autocommit_on = False
95
---> 96 self.client = self.client_class(self)
97 self.creation = self.creation_class(self)
98 self.features = self.features_class(self)
TypeError: Error when calling the metaclass bases
'NoneType' object is not callable
Update: i added
client_class = DatabaseClient
creation_class = DatabaseCreation
features_class = DatabaseFeatures
introspection_class = DatabaseIntrospection
ops_class = DatabaseOperations
validation_class = DatabaseValidation
in mysql/connecotr/django/base.py at DatabaseWrapper (looks like missing? - its there on django1.11/db/backends/mysql/base.py DatabaseWrapper). but now i get the error:
Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS
so i dont know if this solved the issue or created a new one