Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
HOST=0.0.0.0
PORT=8050
2 changes: 2 additions & 0 deletions .env_example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
HOST=0.0.0.0
PORT=8050
9 changes: 7 additions & 2 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,14 @@

def parse_uploaded_file_contents(list_of_file_contents, list_of_file_names):
if not os.path.exists(USER_FILE_UPLOAD_DIRECTORY):
logger.info(f"Creating the user file upload directory: {USER_FILE_UPLOAD_DIRECTORY}." )
os.makedirs(USER_FILE_UPLOAD_DIRECTORY)

for file_content, file_name in zip(list_of_file_contents, list_of_file_names):
uploaded_file_data = file_content.encode("utf8").split(b";base64,")[1]

with open(os.path.join(USER_FILE_UPLOAD_DIRECTORY, file_name), "wb") as uploaded_file:
logger.info(f"Writing file: {file_name}...")
uploaded_file.write(base64.decodebytes(uploaded_file_data))

# return an html Div of the uploaded file names to display to the user
Expand All @@ -155,5 +157,8 @@ def update_output(list_of_contents, list_of_names):


if __name__ == '__main__':
logger.info("Starting the Dash Plotly app...")
app.run(debug=True, host='0.0.0.0', port=8050)
host = os.environ.get("HOST")
port = int(os.environ.get("PORT", 8050))

logger.info(f"Starting the Hinge Data Analysis app on {host}:{port}...")
app.run(debug=True, host=host, port=port)
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ packaging==24.2
pandas==2.2.3
plotly==6.0.0
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
pytz==2025.1
requests==2.32.3
retrying==1.3.4
Expand Down