make mongo uri universal across flask apps
This commit is contained in:
parent
605c25b8b0
commit
3c9618f0b4
3 changed files with 9 additions and 0 deletions
5
_config.py
Normal file
5
_config.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import tomllib
|
||||
from pathlib import Path
|
||||
|
||||
_cfg = tomllib.loads((Path(__file__).parent / "config.toml").read_text())
|
||||
MONGO_URI = _cfg["mongo"]["uri"]
|
||||
2
config.toml
Normal file
2
config.toml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[mongo]
|
||||
uri = "mongodb://root:3wwfoUjyk2E2zWELXFlLuHqfw1ALlOp4pb2H5Vq3TImbMIHL2h1u8Jej2mjzCPl@docdb.connorrhodes.com:35563?tls=true&tlsAllowInvalidCertificates=true"
|
||||
|
|
@ -6,6 +6,8 @@ from flask import Flask, render_template_string
|
|||
from werkzeug.middleware.dispatcher import DispatcherMiddleware
|
||||
from werkzeug.serving import run_simple
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
|
||||
CATEGORIES = ["personal", "home", "work"]
|
||||
|
||||
root = Flask(__name__)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue