Is it possible to perform Includes with flask?

Say I have a template layout saved in template.html. This template includes a banner, side navigation, content container, and footer. Can I use flask to break up these page elements in such a way...

Any way to add a new line from a string with the '\n' character in flask?

I was playing around with flask when I came across an odd problem with the '\n' character. it dosen't seem to have an effect in my browser, I tried putting in there but it didn't work, any...

Parse html form into a list of dicts in python / Flask

I am new to web programming and this is my first SO question, so hopefully I am asking the right way. I am building a simple survey-maker (similar to google forms or survey monkey) and I have a...

Is it possible to load jinja2 templates without having variables replaced?

Suppose we have the following structure templates/modal.html <div class="title"> {% block title %} {% endblock %} </div> <div class="content"> {% block content %} {% endblock...

Swagger API documentation

I saw swagger documentation of Flask and Django. In Flask I can design and document my API hand-written.(Include which fields are required, optional etc. under parameters sections). Here's how we...

Create selectfield options with custom attributes in WTForms

I am trying to create a SelectField or SelectMultipleField that allows me to add attributes to it's <option> tags. I am trying to add attributes like data-id or another data-____. I have not been...

Error generating Swagger server (Python Flask) from Swagger editor

I've used the Swagger Editor to manually generate my Swagger spec file and generated the files for a Python Flask server. Following the README I installed connexion, but when I run python app.py I...

Python Connexion — Control "Type" Key in 400 Response Errors

I'm using connexion, a python library for REST API's, with a swagger definition. It's working properly for the actual requests, but when there is an error condition, such as validation fails, it...

Integrating Swagger/OpenAPI generated python server with existing Flask application

I am interested in integrating a swagger-codegen generated Python server with an existing Flask application. swagger-codegen generates a Python implementation based on the Connexion library from...

Python Connexion - Response Trimming

I'm using Swagger Editor to generate a Python Flask server, I followed the Connexion document but there's a problem: I defined the following response in the swagger YAML file: responses: '200': ...

Connexion class based handling

I'm using the connexion framework for flask. I'd like to group several related functions into a class and I'm wondering whether methods of a class can be used for operationId instead of...

Passenger running Flask site returning 500 error on Dreamhost

I am having trouble getting Passenger to work with Flask. I am running the Flask site on DreamHost inside a virutalenv running Python 3.5.2. The application should receive input from a query...

Python connexion not displaying Swagger UI

I've built a Python/Flask based REST API using the connexion module. This working well as defining the REST API with with swagger.yml file works very well. The application is running, but when I...

Swagger adding custom attributes to parameter definition

We have a python web server app based on connexion and Flask libraries. For audit purposes we print every request, including request body, to the logs. Those logs are much more extensive than what...

Connexion Python framework set multiprocesses

I try to configure Connexion to set the number of processes or threads as is possible in Flask framework. This is possible in Flask but it seems that Connexion is not sending this configuration to...

How to return file contents from controller?

I'm trying to return the contents of an image file via a Python Connexion application generated from an OpenAPI v2 spec file using swagger-codegen and the python-flask language setting. In my...

flask db init Error: Could not import "app.run"

I am trying to initialise my db, and everytime i run the flask db init command, I get that error. I am unsure why, my FLASK_APP and FLASK_ENV are set correctly. I have been reorganising the...

Using OpenAPI to Receive Files in Multipart Messages

I have an API I'm running on Flask/Connexion. The API is written in OpenAPI 3 for Swagger. I send data via multipart/form-data to the endpoint, and everything gets through except the uploaded...

Python Flask - Error: "Failed to load module script. Strict MIME type checking is enforced". Works on production, not on the local server

I have this html file: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="../../../static/css/style.css" type="text/css"...

Flask-Wtf Regex and Length Validation don't working

class checkUserName(FlaskForm): username = StringField('Username',[Length(min=5, max=20),Regexp('[0-9A-Za-z_]+'),DataRequired('Required')]) I want to accept username only combination between...

Nginx web app redirect fails on form submission (redirects to bogus url with %2C in it)

First up, I am new to most of this. I am running a Flask app on a remote (Linode) Ubuntu server. The app is served with Gunicorn and Nginx. After a recent update, redirects began behaving oddly...

Swagger OpenAPI3 POST Array of images and media file together

I am using the swagger python-flask framework to create an OpenAPI 3 API which needs to do the following: 1. Upload a video file 2. Upload an array of images 3. Upload extra string data. I can...

how to fix Flask RESTful api server endpoint failing problem?

I am new to api development using openapi sepc, so I followed this blog where I just used server artifact to understand the code. I used /openapi/photo_album/codegen_server for my simple work. To...

Docker-Compose for react and flask execute the containers with docker-compose up

I use docker-compose to build my flask and react images, but when I run the docker-compose command, my flask container is up but my react container is not activated, and to activate it I ran the...

Get Dialogflow context parameters from a follow up intent in Python

I created a flask app in python to send text to Dialogflow in order to detect the intent and return the fulfillment text as response from it. Then I extended this to also return along the...

Pyinstaller PermissionError: [Errno 13] Permission denied: run.exe

I have a flask app that I made into a gui desktop app with flaskwebgui. I am trying to use pyinstaller to make it an executable for distribution to co-workers. I keep getting this error when I am...

OpenAPI generates code that doesn't pass its own tests

I am trying to use the OpenAPI generator to build a testing mock that simulates an existing service, so I don't have a lot of latitude in terms of changing the schema. I've boiled down the schema...

heroku showing There's nothing here, yet even though app is deployed and worked properly

I have used heroku for 2 months now. Deployed one app, everything worked fine. I actually already finished app development 2 days ago. Everything worked fine also yesterday. Suddenly today I...

Flask-Restx Swagger Doc issue

I am getting AttributeError: module 'flask_restx.api' has no attribute 'doc' when it try add additional for API when using flask restx. How this error can be fixed. api.py from flask import...

How to integrate p5.js with Python Flask

So I'm trying to run a python flask app which should render a html template which will record audio and send it to my flask server. I'm new to p5.js and I'm not able to run/get audio input on my...