include static folder and update path for different machines
This commit is contained in:
parent
3bc413916c
commit
d9f0b90474
29 changed files with 13 additions and 6 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,2 +1 @@
|
||||||
**/__pycache__/
|
**/__pycache__/
|
||||||
static/
|
|
||||||
|
|
@ -7,6 +7,14 @@ import os
|
||||||
import openpyxl
|
import openpyxl
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
def get_uploads_path():
|
||||||
|
path1 = 'C:/Users/Lenovo/Desktop/BudgetingApp/app/static/uploadable/'
|
||||||
|
path2 = '/home/yisroel2/Desktop/budgetingApp/app/static/uploadable/'
|
||||||
|
for p in [path1, path2]:
|
||||||
|
if os.path.exists(p):
|
||||||
|
path = p
|
||||||
|
break
|
||||||
|
return path
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def home():
|
def home():
|
||||||
|
|
@ -16,7 +24,7 @@ def home():
|
||||||
notes = db.session.execute(select(LineItem.note)).all()
|
notes = db.session.execute(select(LineItem.note)).all()
|
||||||
vendors = db.session.execute(select(Vendor)).all()
|
vendors = db.session.execute(select(Vendor)).all()
|
||||||
budget_categories = db.session.execute(select(BudgetCategory)).all()
|
budget_categories = db.session.execute(select(BudgetCategory)).all()
|
||||||
files = os.listdir('C:/Users/Lenovo/Desktop/BudgetingApp/app/static/uploadable')
|
files = os.listdir(get_uploads_path())
|
||||||
return render_template('index.html',
|
return render_template('index.html',
|
||||||
files=files,
|
files=files,
|
||||||
notes=notes,
|
notes=notes,
|
||||||
|
|
@ -26,7 +34,7 @@ def home():
|
||||||
@app.route('/upload_file/<filename>')
|
@app.route('/upload_file/<filename>')
|
||||||
def upload_file(filename):
|
def upload_file(filename):
|
||||||
|
|
||||||
file_path = 'C:/Users/Lenovo/Desktop/BudgetingApp/app/static/uploadable/' + filename
|
file_path = get_uploads_path() + filename
|
||||||
xl = openpyxl.load_workbook(file_path, read_only=True)
|
xl = openpyxl.load_workbook(file_path, read_only=True)
|
||||||
wb = xl.worksheets[0]
|
wb = xl.worksheets[0]
|
||||||
|
|
||||||
|
|
|
||||||
BIN
app/static/Credit_Card_Statements/Export_10_2022.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_10_2022.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_10_2023.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_10_2023.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_11_2022.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_11_2022.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_11_2023.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_11_2023.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_12_2022.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_12_2022.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_12_2023.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_12_2023.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_1_2023.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_1_2023.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_1_2024.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_1_2024.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_2_2023.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_2_2023.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_2_2024.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_2_2024.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_3_2023.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_3_2023.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_3_2024.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_3_2024.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_4_2023.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_4_2023.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_4_2024.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_4_2024.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_5_2023.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_5_2023.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_5_2024.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_5_2024.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_6_2023.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_6_2023.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_6_2024.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_6_2024.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_7_2023.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_7_2023.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_7_2024.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_7_2024.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_8_2023.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_8_2023.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_8_2024.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_8_2024.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_9_2022.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_9_2022.xls
Normal file
Binary file not shown.
BIN
app/static/Credit_Card_Statements/Export_9_2023.xls
Normal file
BIN
app/static/Credit_Card_Statements/Export_9_2023.xls
Normal file
Binary file not shown.
BIN
app/static/uploadable/Updated_Bank_Statement_Two_Years.xlsx
Normal file
BIN
app/static/uploadable/Updated_Bank_Statement_Two_Years.xlsx
Normal file
Binary file not shown.
BIN
instance/site.db
BIN
instance/site.db
Binary file not shown.
|
|
@ -6,10 +6,10 @@ import os
|
||||||
|
|
||||||
def engineer():
|
def engineer():
|
||||||
path1 = 'C:/Users/Lenovo/Desktop/BudgetingApp/instance/site.db'
|
path1 = 'C:/Users/Lenovo/Desktop/BudgetingApp/instance/site.db'
|
||||||
# path2 = ''
|
path2 = '/home/yisroel2/Desktop/budgetingApp/instance/site.db'
|
||||||
# path3 = ''
|
# path3 = ''
|
||||||
|
|
||||||
for p in [path1]:
|
for p in [path1, path2]:
|
||||||
if os.path.exists(p):
|
if os.path.exists(p):
|
||||||
path = p
|
path = p
|
||||||
break
|
break
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue