Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ Thumbs.db
# Database file
# /instance
# votes.db # Ignore the votes database file
# *.db
# *.db
src/votes.db
11 changes: 9 additions & 2 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@
from qiskit import QuantumCircuit
from qiskit_aer import AerSimulator
from qiskit.compiler import transpile
from dotenv import load_dotenv

# This will load the environment variables from the .env file
load_dotenv()

# Assuming the app.py is inside the 'src' directory
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # Get the directory of the current file (src folder)
DATABASE_PATH = os.path.join(BASE_DIR, 'votes.db') # Set the database path inside the src folder
# BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # Get the directory of the current file (src folder)
# DATABASE_PATH = os.path.join(BASE_DIR, 'votes.db') # Set the database path inside the src folder

# This line will get the variable named DATABASE_PATH from the .env file, if it can't find it, it defaults to votes.db
DATABASE_PATH = os.getenv('DATABASE_PATH', 'votes.db')

# Initialize Flask App
app = Flask(__name__)
Expand Down
Binary file modified src/requirements.txt
Binary file not shown.