On this tutorial we will create an API using Python 3 and MongoDB
- Create a Python Virtual Environment.
pip3 install virtualenv
virtualenv -p python3 my-vir-env-py-mon
- Activate and go inside your Virtual Environment
source my-vir-env-py-mon/bin/activate
cd my-vir-env-py-mon
- Clone this project
git clone https://github.com/arturoaviles/python-mongodb
cd python-mongodb
- Install dependencies
pip install -r requirements.txt
- Make a copy of the env.sample to .env
cp env.sample .env
- Configure the .env with your MongoDB Credentials
DATABASE=Your_DB_Name
PASSWORD=Your_DB_Pass
- Run Mongo
Make sure to run in a terminal:
mongod
And then in another (If you want to interact with the DB direclty):
mongo
- Run the API
python server.py
- MongoDB (Youtube Channel)
- Data Wrangling with MongoDB (Udacity)
- How to Install and Secure MongoDB on Ubuntu 16.04 (Digital Ocean)
- How To Back Up, Restore, and Migrate a MongoDB Database on Ubuntu 14.04 (Digital Ocean)
This sample code is licensed under MIT Full license text is available in LICENSE.