This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |