@@ -317,34 +317,26 @@ fields map::
317317Configuring the Automatic Encryption Shared Library
318318===================================================
319319
320- The :ref: `manual:qe-reference-shared-library ` is a preferred alternative to
321- :ref: `manual:qe-mongocryptd ` and does not require you to start another process
322- to perform automatic encryption.
320+ Next, you'll need to configure the :ref: `manual:qe-reference-shared-library `.
323321
324- In practice, if you use Atlas or Enterprise MongoDB, `` mongocryptd `` is already
325- configured for you, however in such cases the shared library is still
326- recommended for use with Queryable Encryption .
322+ First, :ref: ` download the shared library
323+ <manual:qe-csfle-shared-library-download>`. You can choose the latest version,
324+ even if it doesn't match your MongoDB server version .
327325
328- You can :ref: `download the shared library
329- <manual:qe-csfle-shared-library-download>` from the
330- :ref: `manual:enterprise-official-packages `. The shared library is
331- platform‑specific. Make sure to download the correct version for your operating
332- system and architecture.
333-
334- To configure it in your Django settings, use
335- :class: `~pymongo.encryption_options.AutoEncryptionOpts `\' s
336- ``crypt_shared_lib_path `` parameter::
337-
338- from pymongo.encryption_options import AutoEncryptionOpts
326+ After extracting the shared library archive, configure your Django settings to
327+ point to the shared library. For example, on macOS, the name of the shared
328+ library is ``mongo_crypt_shared_v1.dylib ``::
339329
340330 DATABASES = {
331+ # ...
341332 "encrypted": {
342333 # ...
343334 "OPTIONS": {
344335 "auto_encryption_opts": AutoEncryptionOpts(
345336 # ...
346337 crypt_shared_lib_path="/path/to/mongo_crypt_shared_v1.dylib",
347- )
338+ crypt_shared_lib_required=True,
339+ ),
348340 },
349341 },
350342 }
@@ -367,7 +359,13 @@ To configure it in your Django settings, use
367359 | Linux | ``LD_LIBRARY_PATH `` |
368360 +---------------+---------------------------------+
369361
370- For example, on macOS you can set the ``DYLD_FALLBACK_LIBRARY_PATH ``
371- environment variable in your shell before starting your Django application::
362+ For example, on macOS you can set ``DYLD_FALLBACK_LIBRARY_PATH `` in your
363+ shell before starting your Django application:
364+
365+ .. code-block :: console
372366
373367 $ export DYLD_FALLBACK_LIBRARY_PATH="/path/to/mongo_crypt_shared/:$DYLD_FALLBACK_LIBRARY_PATH"
368+
369+ Unlike ``crypt_shared_lib_path `` earlier, the environment variable points
370+ to the directory that contains the shared library, not the shared library
371+ itself.
0 commit comments