- Go to MongoDB website
(skip steps 2 and 3 if you already have an account, just create a new cluster) - On the account setup page, choose wisely your Organization name and Project name (you can't change that). Select Python as preferred language
- Choose
Create a cluster
on theShared Clusters
category (the free one) - Choose
Azure
as provider andNetherlands
as region, then click onCreate Cluster
(it takes 1-5 minutes, but don't close the window !) - When it's done, click on
Network Access
on left panelAdd IP Address
Allow access from anywhere
(because Heroku IP addresses changes everytime)Confirm
(it can take up to 2 minutes)
- Click on
Clusters
on left panelConnect
- Create a Database User (remember the credentials you choose !)
Choose a connection method
Connect with your application
- Choose
Python
as Driver - Choose
3.6 or later
as Version - Copy the URL
- Replace
<password>
with the one you chosen at step 5.ii
Note
It should look like : mongodb+srv://username:[email protected]/?retryWrites=true&w=majority
You can strip the DB name here, it's set on the MONGODB_DBNAME
env var