You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -10,36 +10,25 @@ The development version of this package supports Django 5.0.x. To install it:
10
10
11
11
`pip install django-mongodb-backend`
12
12
13
-
##Get Started
13
+
### Resources
14
14
15
-
This tutorial shows you how to create a Django app, connect to a MongoDB cluster hosted on MongoDB Atlas, and interact with data in your cluster.
15
+
Check back soon as we aim to provide more links that will dive deeper into our library!
16
16
17
-
### Start a Project
18
-
19
-
From your shell, run the following command to create a new Django project called example based on a custom template:
17
+
*[Developer Notes](DEV_NOTES.md)
20
18
21
-
```bash
22
-
$ django-admin startproject example --template https://github.com/mongodb-labs/django-mongodb-project/archive/refs/heads/5.0.x.zip
23
-
```
24
19
25
-
### Create a Connection String
20
+
##Quickstart
26
21
27
-
Check out [Create a Connection String](https://deploy-preview-132--docs-pymongo.netlify.app/get-started/create-a-connection-string/) in our documentation to learn how to obtain a free MongoDB Atlascluster.
22
+
This tutorial shows you how to create a Django project, connect to a MongoDB cluster hosted on MongoDB Atlas, and interact with data in your cluster. To read more, please check our MongoDB Backend for Django tutorials page.
28
23
29
-
Once finished, your URI should look something like this:
- Directly tune MongoDB connection settings within your Django configuration\!
58
+
- Work against a persisted cloud instance of MongoDB for free\!
75
59
76
-
This will register a new `polls` app in your project, and provide the necessary files to have your polls app be a registered in `INSTALLED_APPS` within `example/settings.py` setting. It’ll look like this:
77
60
78
-
```python
79
-
INSTALLED_APPS= [
80
-
"polls.apps.PollsConfig",
81
-
'example.apps.MongoAdminConfig',
82
-
'example.apps.MongoAuthConfig',
83
-
'example.apps.MongoContentTypesConfig',
84
-
'django.contrib.sessions',
85
-
'django.contrib.messages',
86
-
'django.contrib.staticfiles',
87
-
]
88
-
```
61
+
-**Model MongoDB Documents Through Django’s ORM**
62
+
63
+
- Translate Django model instances to MongoDB documents.
64
+
- Create new collections corresponding to models.
65
+
- Supports field validation, data storage, updating, and deletion.
66
+
- Maps Django's built-in fields to MongoDB data types.
67
+
- Provides new custom fields for arrays (ArrayField) and embedded documents (EmbeddedModelField).
68
+
- Supports core migration functionalities including creating, deleting, and updating indexes and collections
89
69
90
-
### Make a Django Model
91
70
92
-
Go to `example/polls/models.py` and paste this example code to creat a `Poll` and `Question` model.
71
+
-**Index Management**
72
+
73
+
- Create single, compound, and unique indexes using Django Indexes
74
+
- Create MongoDB partial indexes in Django using Q notation.
93
75
94
-
```python
95
-
from django.db import models
96
76
77
+
-**Querying Data**
78
+
79
+
- Querying API powered through the amazing MongoDB Aggregation Pipeline
80
+
- Supports most functions of the Django QuerySet API
81
+
- Support Query Annotations and common SQL AGGREGATE operators
82
+
- We support foreign keys and execute JOIN operations all in 1 database call
83
+
- Through our custom raw\_aggregate call, MQL operations like Vector Search, Atlas Search, and GeoSpatial querying still yield Django QuerySet results\!
97
84
98
-
classQuestion(models.Model):
99
-
question_text = models.CharField(max_length=200)
100
-
pub_date = models.DateTimeField("date published")
101
85
86
+
-**Administrator Dashboard & Authentication**
87
+
88
+
- Manage your data in Django’s admin site.
89
+
- Fully integrated with Django's authentication framework.
90
+
- Supports native user management features like creating users and sessions.
# Change values by changing the attributes, then calling save().
149
-
>>> q.question_text ="What's up?"
150
-
>>> q.save()
151
-
152
-
# objects.all() displays all the questions in the database.
153
-
>>> Question.objects.all()
154
-
<QuerySet [<Question: Question object (1)>]>
155
-
```
98
+
## Future Commitments of Django Backend for MongoDB
99
+
100
+
-**Advanced Indexing**
101
+
102
+
- Support for advanced index types like geospatial, text, and vector search indexes.
103
+
104
+
-**Improved Data Modeling**
105
+
106
+
- Support ArrayFields containing Embedded Models
107
+
- Support Collections with multiple Django Models
108
+
- Possible support for additional Django fields such as ImageField
109
+
110
+
111
+
-**Extended Querying Features**
112
+
113
+
- Exploring smoother ways to allow users to use full-text search, vector search, or geospatial querying.
114
+
156
115
157
-
Check out the Django [database API](https://docs.djangoproject.com/en/5.1/topics/db/queries/) documentation for more information on queries.
116
+
-**Enhanced Transactions Support**
117
+
118
+
- Investigation and support for transactions, allowing features like `ATOMIC_REQUESTS` and `AUTOCOMMIT`.
158
119
159
-
### View the Admin Dashboard
160
-
1. Make the poll app modifiable in the admin site. Route to the `polls/admin.py` file and include this code:
161
-
```python
162
-
from django.contrib import admin
120
+
-**Asynchronous Capabilities**
121
+
122
+
- Evaluation and support for Django’s asynchronous callback functions.
163
123
164
-
from .models import Question
165
124
166
-
admin.site.register(Question)
167
-
```
168
-
2. Create a superuser. When prompted, enter your desired username, password, and email address.
169
-
```bash
170
-
$ python manage.py createsuperuser
171
-
```
172
-
3. Start the Development Server
173
-
```bash
174
-
$ python manage.py runserver
175
-
```
176
-
4. Open a web browser and go to “/admin/” on your local domain – e.g., http://127.0.0.1:8000/admin/. Login and explore the free admin functionality!
125
+
-**Performance Optimization**
126
+
127
+
- Focus on performance tuning, especially concerning JOIN operations and ensure competitive performance relative to SQL databases.
177
128
178
-
### Congrats! You've made your first Django MongoDB Backend Project
179
129
180
-
Check back soon as we aim to provide more links that will dive deeper into our library!
130
+
-**Expanded Third-Party Library Support**
131
+
132
+
- Vet our backend library works effortlessly with major Django Third-Party solutions
181
133
182
-
<!-- * Developer Notes
183
-
* Capabilities & Limitations
184
-
* Tutorials
185
-
* Troubleshooting -->
134
+
These future capabilities are intended to enhance the functionality of the Django Backend for MongoDB as it progresses towards a General Availability (GA) release. If you have any more specific questions or need further details, feel free to ask\!
0 commit comments