Skip to content

Instantly share code, notes, and snippets.

View OzzieFZI's full-sized avatar

Peter M Muriuki OzzieFZI

View GitHub Profile
$ mongo "mongodb+srv://datadump-ii2on.gcp.mongodb.net/test" --authenticationDatabase admin --tls --tlsAllowInvalidCertificates --username m001-student --password m001-mongodb-basics
$ mongo "mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?replicaSet=Cluster0-shard-0" --authenticationDatabase admin --tls --tlsAllowInvalidCertificates --username m001-student --password m001-mongodb-basics
//Install postgresql through apt -- https://www.postgresql.org/download/linux/ubuntu/
//Install libpq-dev
$ sudo apt-get install libpq-dev
//install psycopg2 through pip (assuming pip already installed)
$ python3 -m pip install --user psycopg2
@OzzieFZI
OzzieFZI / RESTfulAPI.py
Created June 14, 2018 01:53
Flask API for Simple Database access with GET, POST, DELETE methods and Auth0 authentication
# Simple API for database access
# adopted and modified from tutorial on https://code.tutsplus.com/tutorials/building-restful-apis-with-flask-diy--cms-26625
from flask import Flask, request, jsonify, Blueprint, abort, _request_ctx_stack
from flask_sqlalchemy import SQLAlchemy
from flask.views import MethodView
from flask_cors import cross_origin
from jose import jwt