We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c59279a commit ce3c728Copy full SHA for ce3c728
src/config.py
@@ -1,3 +1,4 @@
1
+import os
2
from flask import Flask, render_template
3
from flask_sqlalchemy import SQLAlchemy
4
@@ -18,8 +19,13 @@
18
19
SYSTEM_NAME = get_system_node_name()
20
SYSTEM_IP_ADDRESS = get_ip_address()
21
22
+HOME_DIR = os.path.expanduser("~")
23
+DB_DIR = os.path.join(HOME_DIR, ".database")
24
+os.makedirs(DB_DIR, exist_ok=True)
25
+# systemguard path = /home/user/.database/systemguard.db
26
+
27
# Configure the SQLite database
-app.config['SQLALCHEMY_DATABASE_URI'] = f'sqlite:///{APP_NAME.lower()}.db'
28
+app.config['SQLALCHEMY_DATABASE_URI'] = f"sqlite:///{DB_DIR}/systemguard.db"
29
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
30
app.config['SECRET_KEY'] = 'secret'
31
0 commit comments