@@ -204,8 +204,40 @@ If you do not want to use the data keys created by Django MongoDB Backend (when
204
204
In this scenario, Django MongoDB Backend will use the newly created data keys
205
205
to create collections for models with encrypted fields.
206
206
207
- Configuring the Crypt Shared Library
208
- ====================================
207
+ Configuring the Automatic Encryption Shared Library
208
+ ===================================================
209
+
210
+ The :ref: `manual:qe-reference-shared-library ` is a preferred alternative to
211
+ :ref: `manual:qe-mongocryptd ` and does not require you to start another process
212
+ to perform automatic encryption.
213
+
214
+ In practice, if you use Atlas or Enterprise MongoDB, ``mongocryptd `` is already
215
+ configured for you, however in such cases the shared library is still
216
+ recommended for use with Queryable Encryption.
217
+
218
+ You can :ref: `download the shared library
219
+ <manual:qe-csfle-shared-library-download>` from the
220
+ :ref: `manual:enterprise-official-packages ` and configure it in your Django
221
+ settings as follows:
222
+
223
+ .. code-block :: python
224
+
225
+ from django_mongodb_backend import parse_uri
226
+ from pymongo.encryption_options import AutoEncryptionOpts
227
+
228
+ DATABASES = {
229
+ " encrypted" : parse_uri(
230
+ DATABASE_URL ,
231
+ options = {
232
+ " auto_encryption_opts" : AutoEncryptionOpts(
233
+ key_vault_namespace = " keyvault.keyvault" ,
234
+ kms_providers = {" local" : {" key" : os.urandom(96 )}},
235
+ crypt_shared_lib_path = " /path/to/mongo_crypt_shared_v1.dylib" ,
236
+ )
237
+ },
238
+ db_name = " encrypted" ,
239
+ ),
240
+ }
209
241
210
242
You are now ready to :doc: `develop with Queryable Encryption
211
243
</topics/queryable-encryption>` in Django MongoDB Backend!
0 commit comments