Django Error When Calling Metaclass Bases
Contents |
here for a quick overview of the site Help Center Detailed error when calling the metaclass bases takes at most 2 arguments answers to any questions you might have Meta Discuss the error when calling the metaclass bases module.__init__() takes at most 2 arguments workings and policies of this site About Us Learn more about Stack Overflow the company error when calling the metaclass bases python Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the error when calling the metaclass bases cannot create a consistent method resolution Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Django: Error when calling the metaclass bases in Models File up vote 2 down vote favorite I'm trying to use social-auth, and
Typeerror: Error When Calling The Metaclass Bases
following the code in documentation. But, when I run python manage.py convert_to_south I'm getting the following error in my models.py TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) This is my models file from django.db import models # Create your models here. class UsuarioManager(models.Manager): def create_user(self, username, email): return self.models._default_manager.create(username=username) class Usuario(models): username = models.CharField(max_length=128) last_login = models.DateTimeField(blank=True, null=True) objects = UsuarioManager() def is_authenticated(self): return True python django share|improve this question asked Nov 1 '13 at 0:15 Filipe Ferminiano 1,13521846 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted You are attempting to extend a module with this class is looks like while you may have intended to extend a class in the module: http://www.gossamer-threads.com/lists/python/python/905168 models.model looks like the the class you want to use: https://docs.djangoproject.com/en/1.8/topics/db/models/ Do your code here would be: from django.
Navigation Start PageIndexHistory Table of contents Newbie mistakes POST to views loses POST data Your forms do not upload files URLconf include() misbehaving Blank object names Integer & NULLS Date & NULLS Appending to a list in session doesn't work Errors about undefined attributes with one-char names I'm using formfields.FormWrapper
Typeerror Error When Calling The Metaclass Bases Multiple Bases Have Instance Lay-out Conflict
and none of my form fields show up Django says "Unable to Open Database typeerror error when calling the metaclass bases object() takes no parameters File" when using SQLite3 How to point apache to your media files directory QuerySets aren't Lists Using reserved name on application breaks admin typeerror error when calling the metaclass bases __init__() keywords must be strings unbound method contribute_to_class() Permission denied when using static serve Default value and Callables PageNotFound BLANK form Newbie mistakes Please feel free to share the things that tripped you up when you started with Django. We'll try http://stackoverflow.com/questions/19718832/django-error-when-calling-the-metaclass-bases-in-models-file to improve Django's error handling to catch such mistakes in the future. POST to views loses POST data Symptom You've got a form that does a POST to some view, and the view doesn't get the POST data from the form. Probable cause You might be missing the / at the end of the form action. If that's the case, the CommonMiddleware (check your MIDDLEWARE_CLASSES redirects to the exact name of the view - https://code.djangoproject.com/wiki/NewbieMistakes and that always includes a trailing slash. Because it does so by using the standard HTTP redirection through Location header, it can't pass on the POST data - and that's why it gets lost. Solution Always make sure that your form actions end with a slash, like this:
Note that Django now attempts to catch this problem, as of [3109]. Your forms do not upload files Symptom You have FileField() and ImageField() fields in your form and the files are not uploaded when you submit this form Probable cause You might be missing the request.FILES argument when intantiate your Form object. Solution Always make sure that you are passing request.FILES when intantiate your Form object: form = MyForm(request.POST, request.FILES) URLconf include() misbehaving Symptom You're trying to get your URLconf files to work, but getting cryptic errors about how there is no module 'index' (where 'index' is some function you are trying to assign as a view), or module 'foo' has no attribute 'urlpatterns'. Probable cause You may have tried to load your view files using include() in the URLconf file (in tutorial 3, this is myproject/settings/urls/main.py). The include() call assumes that the file it's loading is also a URLconf file. Solution Remove the include(). Just give the module and function namSign in Pricing Blog Support Search GitHub https://github.com/divio/django-cms/issues/2114 This repository Watch 312 Star 4,446 Fork https://github.com/applegrew/django-select2/issues/166 1,689 divio/django-cms Code Issues 167 Pull requests 10 Projects 0 Pulse Graphs New issue metaclass conflict with Django 1.6 (latest django-cms develop branch) #2114 Closed stefanocrosta opened this Issue Jul 31, 2013 · error when 25 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 9 participants stefanocrosta commented Jul 31, 2013 I admit I tried to to do something with this but it's far too advanced python for error when calling me, due to the dynamic metaclass inheritance... I'm also not sure if Django is to blame, or django-cms... File "/home/stefano/django/django/utils/autoreload.py", line 93, in wrapper fn(*args, **kwargs) File "/home/stefano/django/django/core/management/commands/runserver.py", line 97, in inner_run self.validate(display_num_errors=True) File "/home/stefano/django/django/core/management/base.py", line 308, in validate num_errors = get_validation_errors(s, app) File "/home/stefano/django/django/core/management/validation.py", line 34, in get_validation_errors for (app_name, error) in get_app_errors().items(): File "/home/stefano/django/django/db/models/loading.py", line 196, in get_app_errors self._populate() File "/home/stefano/django/django/db/models/loading.py", line 75, in _populate self.load_app(app_name, True) File "/home/stefano/django/django/db/models/loading.py", line 99, in load_app models = import_module('.models', app_name) File "/home/stefano/django/django/utils/importlib.py", line 35, in import_module __import__(name) File "/home/stefano/django-cms/cms/stacks/models.py", line 7, in
Sign in Pricing Blog Support Search GitHub This repository Watch 29 Star 400 Fork 188 applegrew/django-select2 Code Issues 7 Pull requests 1 Projects 0 Pulse Graphs New issue Django 1.8 TypeError: Error when calling the metaclass bases #166 Closed garcianavalon opened this Issue Apr 12, 2015 · 2 comments Projects None yet Labels not a bug Milestone No milestone Assignees No one assigned 2 participants garcianavalon commented Apr 12, 2015 When I try to start my django server I get a crash: ... django_select2/fields.py", line 301, in new return type.new(cls, name, bases, dct) TypeError: Error when calling the metaclass bases metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases I think its related to #153 and #160. The fixed uploaded in #160 is not in the actual version from pip. $pip freeze Django==1.8 Django-Select2==4.2.2 Let me know if I can help fix it somehow or if I'm missing something out ;) Thanks, cheers. Collaborator codingjoe commented Apr 12, 2015 Nope, that's right. It's not yet on pypi. I don't feel like releasing this just now, there is still much that needs fixing and more important test coverage. Just install from github, but may I remind you that it might not be stable. codingjoe closed this Apr 12, 2015 codingjoe added the not a bug label Apr 12, 2015 garcianavalon commented Apr 12, 2015 Cool thanks. I will follow the GitHub route as I'm only prototyping and its fine. Thanks again for the quick answer. Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc. Terms Privacy Security Status Help You can't p