Closed ace-han closed 10 years ago
did you find a solution for this?
This is probably caused by a join. Are you using the builtin user model?
To provide some more information on this. The builtin user model uses a many-to-many field for permissions. This field requires a join, so it obviously won't work with MongoDB. Take a look at djangotoolbox/admin.py, that shows how to setup the User admin to stop the join from happening.
If you need to use permissions, then you should look at django-nonrel/django-permission-backend-nonrel.
hi aburgel, I don't understand why looking at the djangotoolbox/admin.py could show me how to setup the User admin... anyways, my problem is not really setting up the admin user, but setting up all other users. All of my users inherit from django's auth.user and thus I have this join issue, and each time I enter the "Users" link in the admin ui I get a : "DatabaseError at /admin/auth/user/ This query is not supported by the database." and I thought it's related to your issue. tnx, Nitzan
As I explained, the builtin User model uses a many-to-many field for permissions. This is not supported by mongodb, so you must disable it. djangotoolbox/admin.py will show you how to disable it.
I understand what you said about the many-to-many field, and that the builtin User model uses it, I just didn't understand the reference to djangotoolbox/admin.py: should I edit it? should I run it? should it just be there, and it'll take care of everything?
Is djangotoolbox in your INSTALLED_APPS list? If so, then it should already be working. What djangotoolbox/admin.py does is customize the User admin screen to not show the many-to-many field, so you won't trigger the join.
Yes, it's in my INSTALLED_APPS, just under django_mongodb_engine.. If I open my project's manage.py shell and do "import djangotoolbox " it doesn't even throw an error. I wonder what wrong then...
Hi, Aburgel
Let's put away the auth staff first, focus on djangotoolbox's issue first.
Since djangotoolbox/admin.py has already unregistered the built-in user model and done below
admin.site.unregister(User)
admin.site.unregister(Group)
admin.site.register(User, CustomUserAdmin)
There should have nothing extra we needed to do already.
However, as I first opened this issue, I've already added djangotoolbox
in INSTALLED_APPS
, still found no luck
Could you show steps for a smooth Get Started
guildline for us to followup, thx.
Hi All,
I am also facing the same issue:
needless to say, i added djangotoolbox to the INSTALLED_APPS
I just pushed up a fix to the master branch. Give it a try. I tested it with django 1.6, but it should also work with django 1.5. I'm going to close the issue but please reopen if you still have issues.
Can you submit the order of your INSTALLED_APPS?
djangotoolbox
needs to go after django.contrib.auth
. I think thats all that matters.
Ok,
Sorry for the mix-up, this is what I wanted to submit:
I'm able to enter the "admin/auth/user/add/", what I couldn't before,
but after submitting the new user I get the following screen:
I'm not sure if it's related to this issue, or I should open a new one, or maybe it's a django-non-rel issue altogether.
When returning to the "admin/auth/user/add/" I can see the users were created.
I think this is a different issue. If you need help on this, please post in the forums.
All the library I installed comes from
pip install django-mongodb-engine
onlyAnd I follow the tutorial, still got below error once login admin site, and click
User
linkI've already got
INSTALLED_APP
includingdjangotoolbox
anddjango_mongodb_engine
as the troubleshooting suggested