Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doableware/djongo
Django and MongoDB database connector
https://github.com/doableware/djongo
django mongodb nosql nosql-databases pymongo relational-databases sql
Last synced: 6 days ago
JSON representation
Django and MongoDB database connector
- Host: GitHub
- URL: https://github.com/doableware/djongo
- Owner: doableware
- License: agpl-3.0
- Created: 2017-07-12T14:00:41.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-11-12T14:34:16.000Z (about 1 month ago)
- Last Synced: 2024-11-24T20:28:35.423Z (28 days ago)
- Topics: django, mongodb, nosql, nosql-databases, pymongo, relational-databases, sql
- Language: Python
- Homepage: https://www.djongomapper.com
- Size: 14 MB
- Stars: 1,885
- Watchers: 48
- Forks: 355
- Open Issues: 350
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-django - djongo - Django and MongoDB database connector. (Third-Party Packages / Database Connectors)
- stars - doableware/djongo - Django and MongoDB database connector (Python)
- stars - doableware/djongo - Django and MongoDB database connector (Python)
README
djongo
[![Build Status](https://travis-ci.com/nesdis/djongo.svg?branch=master)](https://travis-ci.com/nesdis/djongo)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)## The only connector that lets you use Django with MongoDB *without* changing the Django ORM
Use MongoDB as a backend database for your Django project, without changing the Django ORM.
Use the Django Admin GUI to add and modify documents in MongoDB.## Usage:
- Install djongo:
```
pip install djongo
```- Into settings.py file of your project, add:
```python
DATABASES = {
'default': {
'ENGINE': 'djongo',
'NAME': 'your-db-name',
'CLIENT': {
'host': 'your-db-host',
}
}
}
```
- Run
manage.py makemigrations <app_name>
followed bymanage.py migrate
(ONLY the first time to create collections in mongoDB)
- YOUR ARE SET! HAVE FUN!
## Requirements:
1. Python 3.6 or higher.
2. MongoDB 3.4 or higher.
3. If your models use nested queries or sub querysets like:
```python
inner_qs = Blog.objects.filter(name__contains='Ch').values('name')
entries = Entry.objects.filter(blog__name__in=inner_qs)
```
MongoDB 3.6 or higher is required.## How it works
djongo is a SQL to mongodb query compiler. It translates a SQL query string into a mongoDB query document.
As a result, all Django features, models etc. work as is.
Django contrib modules:
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.sessions',
and others... fully supported.## Features
* Use Django Admin GUI to access MongoDB.
* Embedded Model.
* Embedded Array.
* Embedded Form Fields.
Read the [full documentation](https://www.djongomapper.com/)
## Contribute
If you think djongo is useful, **please share it** with the world!You can contribute to the source code or the documentation by creating a simple pull request!
You may want to refer to the design documentation to get
an idea on how [Django MongoDB connector](https://www.djongomapper.com/djongo/django-mongodb-connector-design-document/)
is implemented.Add a star, show some love :)
## Questions and Discussion
* [Djongo groups](https://groups.google.com/d/forum/djongo) is where you can watch for new release announcements, suggest improvements, and discuss topics pertaining to Django and MongoDB.
* Issues, where things are not working as expected, please raise a git-hub issue ticket.
* For questions and clarifications regarding usage, please put it up on stackoverflow instead.