Skip to content

Commit 9a1d52a

Browse files
committed
PYTHON-1144 - Add Atlas usage guide
1 parent 8e4a4f3 commit 9a1d52a

File tree

3 files changed

+56
-13
lines changed

3 files changed

+56
-13
lines changed

doc/atlas.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Using PyMongo with MongoDB Atlas
2+
================================
3+
4+
`Atlas <https://www.mongodb.com/cloud>`_ is MongoDB, Inc.'s hosted MongoDB as a
5+
service offering. To connect to Atlas, pass the connection string provided by
6+
Atlas to :class:`~pymongo.mongo_client.MongoClient`::
7+
8+
client = pymongo.MongoClient(<Atlas connection string>)
9+
10+
Connections to Atlas require TLS/SSL. For connections using TLS/SSL, PyMongo
11+
may require third party dependencies as determined by your version of Python.
12+
With PyMongo 3.3+, you can install PyMongo 3.3+ and any TLS/SSL-related
13+
dependencies using the following pip command::
14+
15+
$ python -m pip install pymongo[tls]
16+
17+
Earlier versions of PyMongo require you to manually install the dependencies.
18+
For a list of TLS/SSL-related dependencies, see :doc:`examples/tls`.

doc/examples/tls.rst

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,37 @@ configuration options supported by PyMongo. See `the server documentation
66
<http://docs.mongodb.org/manual/tutorial/configure-ssl/>`_ to configure
77
MongoDB.
88

9+
Dependencies
10+
............
11+
12+
For connections using TLS/SSL, PyMongo may require third party dependencies as
13+
determined by your version of Python. With PyMongo 3.3+, you can install
14+
PyMongo 3.3+ and any TLS/SSL-related dependencies using the following pip
15+
command::
16+
17+
$ python -m pip install pymongo[tls]
18+
19+
Earlier versions of PyMongo require you to manually install the dependencies
20+
listed below.
21+
22+
Python 2.x
23+
``````````
24+
The `ipaddress`_ module is required on all platforms.
25+
26+
When using CPython < 2.7.9 or PyPy < 2.5.1:
27+
28+
- On Windows, the `wincertstore`_ module is required.
29+
- On all other platforms, the `certifi`_ module is required.
30+
31+
Python 3.x
32+
``````````
33+
On Windows, the `wincertstore`_ module is required when using CPython < 3.4.0
34+
or any version of PyPy3.
35+
36+
.. _ipaddress: https://pypi.python.org/pypi/ipaddress
37+
.. _wincertstore: https://pypi.python.org/pypi/wincertstore
38+
.. _certifi: https://pypi.python.org/pypi/certifi
39+
940
Basic configuration
1041
...................
1142

@@ -23,19 +54,6 @@ This configures PyMongo to connect to the server using TLS, verify the server's
2354
certificate and verify that the host you are attempting to connect to is listed
2455
by that certificate.
2556

26-
PyMongo attempts to use the operating system's CA certificates to verify the
27-
server's certificate when possible. Some versions of python may require an
28-
extra third party module for this to work properly. Users of Python 2 on
29-
Windows are encouraged to upgrade to python 2.7.9 or newer. Users of Python 3
30-
on Windows should upgrade to python 3.4.0 or newer. If upgrading is not
31-
possible `wincertstore <https://pypi.python.org/pypi/wincertstore>`_ can be
32-
used with older python versions. Users of operating systems other than Windows
33-
that are stuck on python versions older than 2.7.9 can install
34-
`certifi <https://pypi.python.org/pypi/certifi>`_ to use the Mozilla CA bundle
35-
for certificate verification. Users of python 2.x that require IP address
36-
support for hostname matching must install the `ipaddress
37-
<https://pypi.python.org/pypi/ipaddress>`_ module.
38-
3957
Certificate verification policy
4058
...............................
4159

doc/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ everything you need to know to use **PyMongo**.
1919
:doc:`examples/index`
2020
Examples of how to perform specific tasks.
2121

22+
:doc:`atlas`
23+
Using PyMongo with MongoDB Atlas.
24+
25+
:doc:`examples/tls`
26+
Using PyMongo with TLS / SSL.
27+
2228
:doc:`faq`
2329
Some questions that come up often.
2430

@@ -85,6 +91,7 @@ Indices and tables
8591
.. toctree::
8692
:hidden:
8793

94+
atlas
8895
installation
8996
tutorial
9097
examples/index

0 commit comments

Comments
 (0)