Spaces:
Sleeping
Sleeping
kandi1clickkits
commited on
Commit
·
5c6b733
1
Parent(s):
007a3ba
chart code with DB
Browse files
main.py
CHANGED
|
@@ -12,6 +12,8 @@ app = FastAPI()
|
|
| 12 |
|
| 13 |
# Use an absolute path for the SQLite database file
|
| 14 |
database_path = os.path.join(os.getcwd(), "test.db")
|
|
|
|
|
|
|
| 15 |
SQLALCHEMY_DATABASE_URL = f"sqlite:///{database_path}"
|
| 16 |
|
| 17 |
# Set up logging for debugging
|
|
|
|
| 12 |
|
| 13 |
# Use an absolute path for the SQLite database file
|
| 14 |
database_path = os.path.join(os.getcwd(), "test.db")
|
| 15 |
+
if not os.path.exists(database_path):
|
| 16 |
+
open(database_path, 'w').close()
|
| 17 |
SQLALCHEMY_DATABASE_URL = f"sqlite:///{database_path}"
|
| 18 |
|
| 19 |
# Set up logging for debugging
|