load dotenv correct

This commit is contained in:
Manuel Weiser 2025-02-03 17:31:29 +01:00
parent 97e7774622
commit 9cefbc6cb7
4 changed files with 11 additions and 0 deletions

1
.gitignore vendored
View File

@ -132,3 +132,4 @@ cython_debug/
.idea/ .idea/
config.env config.env
.DS_Store

View File

@ -1,4 +1,7 @@
import os import os
from dotenv import load_dotenv
load_dotenv()
BASE_URL = os.getenv('OPENSPOOLMAN_BASE_URL') # Where will this app be accessible BASE_URL = os.getenv('OPENSPOOLMAN_BASE_URL') # Where will this app be accessible
PRINTER_ID = os.getenv('PRINTER_ID') # Printer serial number - Run init_bambulab.py PRINTER_ID = os.getenv('PRINTER_ID') # Printer serial number - Run init_bambulab.py

View File

@ -3,3 +3,4 @@ requests==2.32.3
flask==3.1.0 flask==3.1.0
pyopenssl==24.3.0 pyopenssl==24.3.0
gunicorn==23.0.0 gunicorn==23.0.0
python-dotenv

View File

@ -13,13 +13,18 @@
<div class="card-body"> <div class="card-body">
<!-- Tray Sub-Brand and Type --> <!-- Tray Sub-Brand and Type -->
<div class="small text-muted mb-2"> <div class="small text-muted mb-2">
{% if tray_data.tray_type %}
{{ tray_data.tray_type }} {{ tray_data.tray_type }}
{% if tray_data.tray_sub_brands %} {% if tray_data.tray_sub_brands %}
<br/> <br/>
{{ tray_data.tray_sub_brands }} {{ tray_data.tray_sub_brands }}
{% endif %} {% endif %}
{% else %}
Empty
{% endif %}
</div> </div>
{% if tray_data.tray_type %}
<!-- Badge with Dynamic Colors --> <!-- Badge with Dynamic Colors -->
<span class="badge d-inline-block p-2" <span class="badge d-inline-block p-2"
style="background-color: #{{ tray_data.tray_color }}; style="background-color: #{{ tray_data.tray_color }};
@ -36,6 +41,7 @@
<span class="fw-bold">{{ tray_data.remain }}%</span> <span class="fw-bold">{{ tray_data.remain }}%</span>
{% endif %} {% endif %}
</div> </div>
{% endif %}
</div> </div>
<div class="card-footer"> <div class="card-footer">
{% if pick_tray %} {% if pick_tray %}