Giter Club home page Giter Club logo

Comments (15)

aburgel avatar aburgel commented on July 1, 2024 2

djangotoolbox needs to go after django.contrib.auth. I think thats all that matters.

from djangotoolbox.

nitzanw avatar nitzanw commented on July 1, 2024

did you find a solution for this?

from djangotoolbox.

aburgel avatar aburgel commented on July 1, 2024

This is probably caused by a join. Are you using the builtin user model?

from djangotoolbox.

aburgel avatar aburgel commented on July 1, 2024

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.

from djangotoolbox.

nitzanw avatar nitzanw commented on July 1, 2024

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

from djangotoolbox.

aburgel avatar aburgel commented on July 1, 2024

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.

from djangotoolbox.

nitzanw avatar nitzanw commented on July 1, 2024

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?

from djangotoolbox.

aburgel avatar aburgel commented on July 1, 2024

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.

from djangotoolbox.

nitzanw avatar nitzanw commented on July 1, 2024

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...

from djangotoolbox.

ace-han avatar ace-han commented on July 1, 2024

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.
already_added_djangotoolbox

from djangotoolbox.

kmad1729 avatar kmad1729 commented on July 1, 2024

Hi All,

I am also facing the same issue:

screen shot 2013-12-16 at 6 30 35 pm

needless to say, i added djangotoolbox to the INSTALLED_APPS

from djangotoolbox.

aburgel avatar aburgel commented on July 1, 2024

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.

from djangotoolbox.

nitzanw avatar nitzanw commented on July 1, 2024

Can you submit the order of your INSTALLED_APPS?

from djangotoolbox.

nitzanw avatar nitzanw commented on July 1, 2024

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:
nonrel-user_render
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.

from djangotoolbox.

aburgel avatar aburgel commented on July 1, 2024

I think this is a different issue. If you need help on this, please post in the forums.

from djangotoolbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.