title: How to correctly use MongoDB client connections
body: <p>I'm building a simple test web application that stores info users enter in a mongo database.</p>
  
  <p>No errors come up, but I always get the following warning (Im using django) when using the client.</p>
  
  <pre><code>/home/&lt;User&gt;/.local/share/virtualenvs/&lt;Name&gt;/lib/python3.7/site-packages/pymongo/topology.py:155: UserWarning: MongoClient opened before fork. Create MongoClient only after forking. See PyMongo's documentation for details: http://api.mongodb.org/python/current/faq.html#is-pymongo-fork-safe                                                       
    "MongoClient opened before fork. Create MongoClient only "
  </code></pre>
  
  <p>After checking out the API docs, it seems that the warning pops up when using <code>fork()</code> which im not explicitly using.</p>
  
  <p>Maybe something that I'm doing is actually triggering the fork.</p>
  
  <p>I create my mongo client at <code>__init__</code> and then import the variable to my mongoDB handler. Then, that client that I imported is used inserting or updating items in the DB.</p>
  
  <p>What is the correct way of creating and then using a mongo client to prevent this warning from appearing?</p>