Update app.py
Browse files
app.py
CHANGED
@@ -148,10 +148,7 @@ def download_pdf():
|
|
148 |
renda_fixa=renda_fixa,
|
149 |
inflacao=inflacao)
|
150 |
|
151 |
-
#
|
152 |
-
with open("debug_relatorio.html", "w", encoding="utf-8") as f:
|
153 |
-
f.write(html_content)
|
154 |
-
|
155 |
pdf = HTML(string=html_content).write_pdf()
|
156 |
|
157 |
response = make_response(pdf)
|
@@ -164,6 +161,7 @@ def download_pdf():
|
|
164 |
return f"Erro: {e}\n\n{tb}"
|
165 |
|
166 |
|
|
|
167 |
if __name__ == '__main__':
|
168 |
app.run(host='0.0.0.0', port=7860, debug=True)
|
169 |
|
|
|
148 |
renda_fixa=renda_fixa,
|
149 |
inflacao=inflacao)
|
150 |
|
151 |
+
# Não salva em disco: evita erro de permissão
|
|
|
|
|
|
|
152 |
pdf = HTML(string=html_content).write_pdf()
|
153 |
|
154 |
response = make_response(pdf)
|
|
|
161 |
return f"Erro: {e}\n\n{tb}"
|
162 |
|
163 |
|
164 |
+
|
165 |
if __name__ == '__main__':
|
166 |
app.run(host='0.0.0.0', port=7860, debug=True)
|
167 |
|