skip to Main Content

Docker with postgresql in flask web application (part 2)

I am building a Flask application in Python. I'm using SQLAlchemy to connect to PostgreSQL. In the flask application, I'm using this to connect SQLAlchemy to PostgreSQL engine = create_engine('postgresql://postgres:[mypassword]@db:5432/employee-manager-db') And this is my docker-compose.yml version: '3.8' services: backend: build:…

VIEW QUESTION

Flask send_file done with JavaScript – Jquery

I have this flask app route: @app.route('/generatecleanbudgetfile', methods=['GET', 'POST']) def clean_budget(): file = request.files.get('data_file') app.logger.info('Budget Formatting request has started') try: if request.method == 'POST': file = request.files.get('data_file') file.seek(0) buffer = budget_cleaner(file) buffer.seek(0) app.logger.info('Conversion Complete') return send_file( buffer, as_attachment=True, attachment_filename=f'stripped_budget_{dt.today().strftime("%m.%d.%Y")}.xlsx', mimetype='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'…

VIEW QUESTION
Back To Top
Search