Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Authentication Mongodb

Tags:

mongodb

django

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.

like image 285
disappearedng Avatar asked Dec 28 '10 07:12

disappearedng


People also ask

Can Django connect to MongoDB?

There are three ways to connect Django to MongoDB: PyMongo: PyMongo is the standard driver through which MongoDB can interact with Django. It is the official and preferred way of using MongoDB with Python. PyMongo provides functionality to perform all the database actions like search, delete, update, and insert.

Does Django have authentication?

Django provides an authentication and authorization ("permission") system, built on top of the session framework discussed in the previous tutorial, that allows you to verify user credentials and define what actions each user is allowed to perform.

Which is better PyMongo or MongoEngine?

Both PyMongo and MongoEngine can be used to access data from a MongoDB database. However, they work in very different ways and offer different features. PyMongo is the MongoDB recommended library. It makes it easy to use MongoDB documents and maps directly to the familiar MongoDB Query Language.

Can I use PyMongo with Django?

PyMongo is the official distribution recommended by Python to connect your Django application to a MongoDB database. PyMongo is an open-source Python distribution containing tools for interacting with MongoDB. It makes it easier to perform CRUD operations (Create, Read, Update, and Delete) with a MongoDB database.


1 Answers

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.

like image 120
duy Avatar answered Sep 16 '22 11:09

duy