I am having trouble rendering this specific json object using the jinja template engine view full json object here Shortened version: { "data": { "domain.org": { "type": "folder", "children&q ...
I have developed a web application using Flask that allows users to upload files to an S3 storage. However, I would like to enhance the user experience by showing them the progress of their file uploads in real-time. To achieve this, I am utilizing Flash t ...
I am facing a challenge in figuring out how to capture a video using openCV. While I have managed to display the video on an html template with the existing codes, I am uncertain about which codes are needed to actually record the video. -camera.py- i ...
I am looking to define a unique and optional attribute in Python Sql Alchemy with Flask and Flask-SQLAlchemy. Is this achievable? membership_number = db.Column(db.String(120), unique=True) ...
I'm having issues trying to implement file uploads using flask-uploads. I've encountered some obstacles while working on it and I need some assistance. Below, I will display my flask view function along with the HTML code, in hopes that someone can help me ...
After struggling for a week, I am still lost on where to make changes in my code. I need the checkbox to return a boolean value in my Flask application. Below are snippets of the relevant code: mycode.py import os, sqlite3 from flask import Flask, flash ...
Hello there, I am currently working on integrating custom CSS into my Flask application. While I had no issues loading Bootstrap, I seem to be facing some difficulties with my local CSS. Below is the method I am using to load my CSS: <link rel="st ...
Currently, I am working on transferring URLs from an extension to a Flask app. The extension is able to access the current URL of the website. I have set up an AJAX request to connect to Flask, and the connection is successful. However, when trying to send ...
I'm handling an html form and want to make sure that all submissions originate from my website. I've noticed others using a key for this in Django, and I'm considering implementing something similar. Is there a recommended approach for achieving this in Fl ...
As a beginner in web scraping, I am gradually making progress. However, I'm facing a tough challenge with this particular task. My goal is to extract data from the ESPN NBA boxscore website: I aim to scrape the names of players labeled as "DNP" (Did Not ...
I have a complex calculation that I need to perform, and because of the gateway timeout issue, I am looking to run the calculation in a background thread. I attempted to use Python threading but encountered some difficulties. import time import threadin ...
I have a strong aversion to JavaScript. I find it to be quite messy and disorganized as a language. However, I recognize that my lack of proficiency in coding with it may contribute to this perception. These past few days have been incredibly frustrating ...
Can you help me figure out how to make the current_time variable update each time the webpage is reloaded in Flask? from flask import Flask, render_template app=Flask(__name__) import time from datetime import datetime from apscheduler.schedulers.backgro ...
Initially, the user id and password are submitted from the UI (angular) to Flask: public send_login(user){ console.log(user) return this.http.post(this.apiURL+'/login',JSON.stringify(user),this.httpOptions) .pip ...
Hey there, experiencing an issue with my Flask application. Here's the recursion error I'm facing: *File "/Users/Desktop/Flask_Blog/flaskblog.py", line 20, in __repr__ return f"User('{self.username}', '{self.email}', '{self.image_file}')&quo ...
Below is the original code I wrote in JavaScript: var wt_val = []; for (i = 0; i<human_wt.length; i++){ var mult; mult = data_list[basket_list[button_port_name][i]].map(x => x*(wt[i]/100)); wt_val.push(mult); ...
Is there a way to log request headers in the logfile without getting all those blank lines in between? I've tried using: logging.debug("Headers:{0}".format(request.headers)) but the output is full of empty lines. I noticed there are '/r/n' characters bet ...
While writing a unit testing function for my Flask view, I encountered an AssertionError. The error message I received is as follows: Traceback (most recent call last): File "C:\Users\Administrator\Desktop\eind\Joy-1\web ...
I have two files, app.py and views.py app.py from flask import Flask from flask_pymongo import PyMongo app = Flask(__name__) app.config["MONGO_URI"] = "mongodb://local:27017/local" mongo = PyMongo(app) from views import profileview profileview.register(ap ...
Introduction: I have explored similar inquiries and attempted to apply relevant code/concepts but without success. -https://stackoverflow.com/questions/43645790/passing-javascript-variable-to-python-flask -https://stackoverflow.com/questions/10313001/is- ...
I am facing an issue with form submission. Even though I believe that the login and password data are being sent correctly, nothing happens when I submit the form. I am attempting to submit the form without using ngSubmit because it is not feasible in my s ...
My HTML webpage requires real-time updates for one or more labels. To achieve this, I have incorporated CSS and JS animations into the design. Currently, I am utilizing Flask to handle all the calls. I face a challenge where I need to consistently update ...
I am attempting to utilize a function that I have defined in my .js file within my HTML document. js/newsalerts.js function decodeHTML(html) { //https://stackoverflow.com/a/2989105/4650297 var tempDiv = document.createElement("DIV"); tempDiv. ...
Recently, I encountered an issue while working on a project using Python with Flask. I had created a REST API and needed my Vue app to interact with it and fetch data. However, I kept receiving an error message stating "No 'Access-Control-Allow-Origin' hea ...
I'm currently working on Flask and encountering a perplexing issue. I'm attempting to update an image using JavaScript, but I am getting these errors from Flask: ... 12:05:34] "GET / HTTP/1.1" 200 - ... 12:05:38] "GET /img/pictur ...
I am currently in the process of creating a web application utilizing AngularJS along with a REST-API developed using the Flask framework. This application is broken down into two main components: The first part allows users to interact without loggin ...
Thank you in advance. I'm currently working on an application using Flask and SQLAlchemy. When I first started, I initialized the database by running flask db init. $ flask db init Creating directory /Users/xxxx/app/migrations ... done Creating dire ...
I recently developed a bulk WhatsApp message sender application that allows for sending multi-line text messages. However, I encountered an issue on WhatsApp web where pressing enter sends the message right away. My goal is to have it press shift + enter ...
Any ideas on resolving the issue of an app running on the wrong port? I would like my localhost to use port 8080 instead of 5000. I attempted to run port 8080 through the terminal, but it was unsuccessful. Port 5000 is not compatible with my current proj ...
I am currently working on a basic configuration where I need to send a string to my Flask application through Ajax, but unfortunately, I am encountering Error code 400: Bad request. Here is the JavaScript code snippet: headers = { 'Content-type&a ...
My current project involves building a YouTube scraper webpage purely for educational purposes. I have created a web page with a text box to enter search queries and a search button. When the button is clicked, an Ajax post request is sent with the text bo ...
Hello from Argentina! I'm new to programming and recently started a Flask project. I've successfully displayed information from an API using one endpoint and rendered it with Flask. However, I'm now facing the challenge of displaying informa ...
I need help validating an email input field in Flask for a user. Currently, I am using WTForms' Email validation method, but it does not allow users to include dashes in their email addresses. Here is my code: from flask_wtf import FlaskForm from wtforms i ...
My Flask Celery app instantiates the celery instance. I'm aware that I can add a normal Flask route to the same .py file, but would need to run the code twice: To run the worker: % celery worker -A app.celery ... To run the code as a normal ...
I have exhausted all the available solutions to my issue, but I still can't seem to pinpoint the problem. Despite trying every solution out there, nothing seems to be of any help. Every time I make a request, the browser blocks it due to CORS Policy. My ...
Currently in my project, I am using a Python backend to fetch data from an API and then rendering it through Flask to the Vue.js frontend. However, I have encountered an error titled that is causing some issues. I have double-checked and printed the varia ...
Could someone explain the process of assigning a CSS class to the choices values? I am looking to customize the background of each choice with a small image. How can this be done using wtforms and CSS? class RegisterForm(Form): username = TextField( ...
I have been troubleshooting this issue and reviewed similar threads, yet despite verifying all options, the problem persists. My code includes: application.py @app.route("/Booksearch/<int:book_id>", methods=["GET", "POST"]) def Bookdetails(book_id ...
Within my Flask Python web application, I store certain parameters in SessionStorage to later send back to Flask and save this data as a text file. Interestingly, the process functions perfectly on PCs and Android devices but encounters issues on iOS devi ...
I'm currently in the process of learning how to utilize ajax with Flask. My approach involves sending an ajax request and handling the data as a post request within my Python file. The code snippet in my HTML file: var data = {"name":"John Doe","age ...
Utilizing Flask along with Google's geocode API to retrieve data on a city, my goal is to return its coordinates in JSON format. Below is the relevant code snippet. from flask import Flask, request, json import googlemaps from datetime import datetime imp ...
In an effort to enhance the responsiveness of my app, I am looking for a way to prevent the page from reloading every time a POST request is sent. My current setup includes a dynamically generated form with input fields designed like this: <div class=&q ...
I have a question regarding my Python Flask script. I am fairly new to Python and Flask, so please bear with me. The second decorator in my code is supposed to return the subprocess to the /results page. While the ping test does print in the terminal, I ...
app = Flask(__name__) @app.route('/' , methods = ['GET', 'POST']) def index(): print("hello") if request.method == 'GET': text = request.args.get("image") print(text) base64_img_bytes = text.en ...
I have a situation in HTML where I need to constantly update an image file with the latest images that come in. Below is the Flask code snippet: @app.route('/uploads/update_file', methods=['GET', 'POST']) def update_file(): ...
After successfully running my app locally with "Flask run", I encountered an error when trying to deploy it on Heroku. The structure of my app is similar to the microblog flask tutorial with blueprints. Upon accessing the deployed website, I received the f ...
Currently, I am working on building a basic API using Python and the Flask Framework. While I am able to generate the desired output, I am facing an issue with the way it is being presented - in alphabetical order. My goal is to customize the output to dis ...
While working on my localhost, I came across a CORS error when building an application to handle search queries for a different domain. The specific error was: "Cross Origin Request Blocked... (Reason: CORS header 'Access-Control-Allow-Origin' missing)". A ...
I am currently developing a full stack website with Flask, Vuejs and SQLite3. I have been using axios to make backend calls from the frontend. However, I noticed that when I make 'GET' requests using axios (Vuejs) to the backend on a particular route, all ...
When sending emails from a website's contact form using Flask Mail, I encounter an issue. The email recipient is set correctly, but the "from" field in the received email defaults to the SMTP MAIL_USERNAME, rather than the sender's email entered ...
I have developed a basic Flask jsonify function that returns a JSON Object, although I am not certain if it qualifies as an API. @app.route('/searchData/<int:id>',methods=["GET"]) def searchData(id): return jsonify(searchData(id)) Curr ...
Upon reviewing my logfile, I noticed numerous entries indicating attempts to load files like /favicon.ico GET - /favicon.ico GET - /apple-touch-icon.png GET - /apple-touch-icon-precomposed.png I have researched this issue extensively online, but have bee ...
Hello, I am new to using cytoscape.js and currently working on rendering shallow networks in a Flask App. At the moment, I have managed to display node and edge attributes when hovering over them, but the information is shown in a format that is not very ...
Having recently started learning Flask, I have challenged myself to build my own API in order to become more proficient with the platform. Purpose of the API: Authenticated users should be able to access the endpoint www.mydomain.com/api/ and perform ...
Recently, I was involved in a project that hosts its application on GAE. During a late-night deployment to the QA server (also on GAE), a cron job in the cron.yaml file was commented out. To my surprise, the cron task ran as soon as the deployment was com ...
Currently working on a CTF challenge, my query is not seeking assistance in solving it, but rather pertains to syntax. The task involves retrieving the secret key from Flask server's configuration. This key is stored within the app.secret_key variable, and ...
Need help fixing the output of a Python list returned to Ajax, as it appears strange. ap.py @app.route('/_get_comUpdate/', methods=['POST']) def _get_comUpdate(): comNr = request.form.get('comNr') com_result = COMPort("ON","COM255",comNr) ...
Just starting out with python and experimenting with flask. Created a simple web page where ASCII art can be uploaded, following a tutorial from an Udacity course. However, when uploading ASCII art, I encountered an error message: ValueError: Detected ne ...
I want to turn off Jinja2's template cache feature. After some research, I discovered that there's a cache_size parameter available for the jinja environment. My current implementation is as follows: app.jinja_env = jinja2.Environment( cache ...
I am encountering an issue with my Flask server that sends a PDF file using the send_file function. When testing this route on Postman, I am able to view and download the PDF successfully. However, when attempting to download it through my React frontend, ...
My aim is to send a JSON formatted string from an Android device to a Flask server. To achieve this, I am utilizing Apache MultiPartEntityBuilder for sending, as I also need to include an image file in the same http post message. While I have successfully ...
In the Flask-Admin list view (ModelView) of my user model, I have successfully excluded some fields and customized headers. The functionality is as expected, and I have even taken the extra step to modify the default list template so it aligns with the sty ...
In the python flask application that I have built with Angular JS for the front end, there are three main files. app.py import json import flask import numpy as np app = flask.Flask(__name__) @app.route("/") def index(): ...
I am currently working with Weasyprint to showcase some Jinja templates within a Flask Web App. Here is the JSON data I am using: value=["1","2","3","4"] My goal is to pass the 'value' variable to another Jinja template within an if statement. {% if (v ...
Building a web application where user actions can impact bar graphs, some changes are not saved. Reloading the page sometimes shows the updated bar graphs, indicating that the user's actions were saved. However, upon further reloads, the changes may or may ...
As a newcomer to web development and JavaScript, I'm struggling to pass an array from a Flask function into a JavaScript function. Here's what my JS function looks like: function up(deptcity) { console.log('hi'); $.aja ...
I have implemented Hufman's Honeywell Python code to extract data from the MyTotalConnectComfort website. The code can be accessed here. I made adjustments to the code for compatibility with version 2.7 and integrated Flask into the process. Upon calling ...
Here is the code I used to connect my two stylesheets, with the custom css file being linked second as per what I believe is the correct way to do it. <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" href=" ...
I am currently working on a ReactJS website as a part of my web development bootcamp project. One interesting feature I have incorporated is a search functionality that uses Flask routes to connect ReactJS endpoints (../Language.js) with my Sqlite3 databa ...
Hey there! I'm currently working on organizing the API documentation for a blueprint by consolidating it into a single .yaml file. However, I seem to be facing an issue with flasgger not recognizing the correct definition within my current file structure a ...
My current dilemma involves a rather peculiar situation with my flask/react app. Initially, everything was running smoothly on localhost:5000 via Flask. However, after closing the terminal application, the server continued to run inexplicably. Now, whene ...
I am currently facing an issue with my flask server running through gunicorn and nginx where it is not parsing certain characters like the plus sign (+) correctly in the arguments of the http messages. For instance, when I check the nginx log, I see: [04 ...
I am currently running 2 servers on localhost, each with different ports. One of them is a basic flask server in Python and its code is provided below: from flask import Flask,jsonify from flask_cors import CORS app = Flask(__name__) CORS(app) @app.rout ...
Is it possible to store "jsonify" in a variable? I find the pure json format of "return jsonify(data)" unappealing, so I am looking for a way to enhance it using an HTML template with proper indentation. Here's the python code I have: from flask import Fl ...
I'm facing an issue while attempting to retrieve a BLOB (LargeBinary) object from SQLite using Flask-SQLAlchemy. The error message I'm encountering is: TypeError: must be string or read-only buffer, not None. This is the code snippet that I am working wit ...