12

Hi everyone I want to use django's built in authentication with mongodb. I have looked online and they aren't really any stable and solid solutions.

Has anyone mongodb fans out there who can point out to me how this can be achieved with minimal hacking? That would be great.

1

1 Answer 1

8

You can't simply use Django built in authentication with MongoDB because MongoDB is not supported as a back-end for django.db which is an ORM for Django Authentication. However you may use 3rd modules like MongoEngine or MongoKit to overcome this problem as they all provide Authentication Module for MongoDB Django apps.

Note: The folks at MongoEngine provide an awesome open source project named Mumblr which is good to use as a starter for your Django-MongoDB project.

Sign up to request clarification or add additional context in comments.

3 Comments

Hey I looked at their source and they seem to be providing an external authentication module rather than integrating it with the django's contrib auth. I wanted to use django-registration on top of django-auth which makes the entire registration + authentication. I don't think I can do so with either mongokit or mongoengine because django-registration relies heavily on django.contrib.auth. I was looking more for an answer to make django "integrate" mongodb. I guess I will just 2 separate db for now.
Yes you get it right. As I said the Django Contrib Auth lib is tied to django.db which is not supported by PyMongo (the driver). Hence we can't just use the native Django Contrib Auth. Moreover, the combination between Django and Non-Relational DBs like MongoDB at this stage is just too 'premature' as we can't have a stable, native supported Authentication feature. Maybe we have to wait for the folks at Django to release this feature. At this stage, we have to find a workaround solution however. I have to rely on Mumblr to develop my own CMS. (cont.)
(cont.)I know somebody tried to do that: Mango(github.com/vpulim/mango) and Django-MongoDB(bitbucket.org/kpot/django-mongodb) . Also, checkout this presentation(slideshare.net/mdirolf/mongodb-lt3s-django-django-nyc) will give you more insights.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.