working branch #1
@@ -1,15 +1,15 @@
|
||||
from flask import Flask, render_template, make_response, json
|
||||
import app_obd, app_car, app_account, app_gps, time
|
||||
from app_events import socketio
|
||||
import modules.app_obd, modules.app_car, modules.app_account, modules.app_gps, time
|
||||
from modules.app_events import socketio
|
||||
from gevent.pywsgi import WSGIServer
|
||||
|
||||
app = Flask(__name__)
|
||||
socketio.init_app(app)
|
||||
|
||||
account = app_account.Account()
|
||||
obd = app_obd.OBD()
|
||||
car = app_car.Car()
|
||||
gps = app_gps.get_gps()
|
||||
account = modules.app_account.Account()
|
||||
obd = modules.app_obd.OBD()
|
||||
car = modules.app_car.Car()
|
||||
gps = modules.app_gps.get_gps()
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
from pymongo import MongoClient
|
||||
from dotenv import load_dotenv
|
||||
import os
|
||||
|
||||
load_dotenv("./creds.env")
|
||||
|
||||
mUser = os.getenv()
|
||||
mPass = os.getenv()
|
||||
mDB = os.getenv()
|
||||
|
||||
def get_database():
|
||||
|
||||
# Provide the mongodb atlas url to connect python to mongodb using pymongo
|
||||
CONNECTION_STRING = "mongodb+srv://"+ mUser + ":" + mPass + "@cluster.mongodb.net/" + mDB
|
||||
|
||||
# Create a connection using MongoClient. You can import MongoClient or use pymongo.MongoClient
|
||||
client = MongoClient(CONNECTION_STRING)
|
||||
|
||||
# This is added so that many files can reuse the function get_database()
|
||||
if __name__ == "__main__":
|
||||
|
||||
# Get the database
|
||||
dbname = get_database()
|
||||
@@ -0,0 +1,7 @@
|
||||
##
|
||||
## MangoDB server connection details
|
||||
##
|
||||
|
||||
mangosrv_user = ""
|
||||
mangosrv_pass = ""
|
||||
mangosrv_db = ""
|
||||
@@ -0,0 +1,4 @@
|
||||
## TSV File to MangoDB
|
||||
## VN_20240401_00_00_00.TSV
|
||||
##
|
||||
## VN NAME, DATE, TIME, GPS_X, GPS_Y, SPEED, ODOMETER
|
||||
|
@@ -1,3 +1,5 @@
|
||||
Flask
|
||||
Flask-SocketIO
|
||||
gevent
|
||||
pymongo
|
||||
python-dotenv
|
||||
Reference in New Issue
Block a user