yusufgundogdu commited on
Commit
e37b9c9
·
verified ·
1 Parent(s): 40d7f8a

Update database.py

Browse files
Files changed (1) hide show
  1. database.py +1 -6
database.py CHANGED
@@ -3,16 +3,11 @@ import os
3
  from flask import g
4
 
5
  def get_db_path():
6
- # Hugging Face Spaces için özel yol
7
- if os.path.exists('/data'):
8
- return '/data/database.db'
9
- return 'database.db' # Local testler için
10
 
11
  def get_db():
12
  if 'db' not in g:
13
  db_path = get_db_path()
14
- # Dizin yoksa oluştur (Hugging Face için gerekli değil ama local için)
15
- os.makedirs(os.path.dirname(db_path), exist_ok=True)
16
  g.db = sqlite3.connect(db_path)
17
  g.db.row_factory = sqlite3.Row
18
  return g.db
 
3
  from flask import g
4
 
5
  def get_db_path():
6
+ return 'database.db' # Direkt proje dizininde
 
 
 
7
 
8
  def get_db():
9
  if 'db' not in g:
10
  db_path = get_db_path()
 
 
11
  g.db = sqlite3.connect(db_path)
12
  g.db.row_factory = sqlite3.Row
13
  return g.db