Recently, I came across a fascinating scenario involving a JSON file stored in a Cloud Storage bucket. Is there an effective approach to read and potentially modify the data within using Python? @app.route("/myform/", methods=('GET', 'POST')) def myform() ...
Below is the code snippet for file uploading: Here is the HTML code used to select and upload the file: <form ng-click="addImportFile()" enctype="multipart/form-data"> <label for="importfile">Import Time Events File:</label><br&g ...
I am currently developing a visualization application using a flask server and vue.js for the front end. Other discussions on this topic explore how to avoid conflicts between vue.js and flask variable syntax, as shown here. In my scenario, I'm inte ...
How can I update a relationship property in py2neo or cypher after it has been initially set? In my inventory tracking system, when an item is checked out, the "status" property in the relationship is set to "True". However, I'd like to change this propert ...
Whenever the mobile app requests specific data, I must execute a task. The user may not need the task completed immediately, but within the next 2 minutes. Being relatively new to Python and web development, I am unsure of how to achieve this. I prefer n ...
I've hit a roadblock with my personal project involving making Fetch API calls to retrieve the audio source for a list of HTML audio tags. When I trigger the fetch call by clicking on a track, it always calls /play_track/1/ and adds the audio player only ...
I'm encountering an issue while attempting to serve a zip file generated in memory by Flask to a JavaScript front-end. However, the downloaded file appears corrupted and I am unsure of what mistake I may be making. @app.route('/route') def test_zip(): ...
I am currently working on integrating React Contact form with MYSQL Workbench using Flask. I have set up the database initialization and model using SQLAlchemy, but I am encountering an issue with the render_template function. Is it possible to render th ...
Recently, I ventured into the world of React and Flask development by following a tutorial found at this link. After completing the example fullstack website project, I realized that my code mirrored exactly what was provided by the author on their Github ...
Is it necessary to ensure proper handling of user-generated data (such as cookie values, variable segments in URLs, and query arguments), or can Flask sanitize and escape input automatically before passing it to a function like test(input_data)? ...
I am in the process of developing a React Component that will display data retrieved from an AJAX call. Here's my scenario - I have a Jinja Flask back end hosted on AWS API Gateway, which requires custom headers and the Authorization header to serve HTML a ...
Currently, I am developing a contact application using Python with React. While utilizing Vite and Flask for development, I encountered an error stating that 'React' is defined but never used. Below is a snippet of my code structure: This section represen ...
I'm currently facing an issue with properly formatting a response using Flask.requests.json @app.route("/slack/post", methods=["POST"]) def post_response_to_slack(): try: body = request.json The output when using request.data is: b'{"phone":" ...
I'm currently developing a small Flask-based website and I want to use Ajax to send data from the client to the server. So far, I've only used Ajax requests to fetch data from the server, but this time I want to submit data via a POST request. On the Flas ...
I have a unique flask application that initiates with python3 app.py running on localhost:5000 Moreover, there is another distinct nodejs program that kicks off with npm run start which operates on localhost:3000 The challenge that lies ahead for m ...
I encountered an issue while trying to deploy a simple Flask app that utilizes Google Bucket. Upon deployment, I kept getting error 503 - Service Unavailable. I'm unsure if I missed something crucial or what exactly I might be doing wrong. Any assistance ...
Currently, I am constructing a website using React alongside Python with Flask. An issue has arisen where the session data is being lost between sessions and the cause remains unknown. Within the app.py file in Python, you can find the following app confi ...
I am currently exploring how to retrieve all data passed to a template from a jQuery function by accessing Flask's DB query. I have a database table with customer names and phone numbers, which I pass to the template using Flask's view method "db.query.all ...
I am currently working on a project in my Flask app where I need to store data retrieved from the request.headers. My goal is to display the index.html when the page loads, but I also want to extract the email of the user visiting so that I can utilize it ...
I have a JavaScript file that enables dynamic drop-down menus (i.e. selecting one option affects the others). However, I hard-coded the starting variables in this file to HTML elements 'inverter_oem' and 'inverter_model_name'. Now, I need to reference diff ...
As I embark on my journey with Python Flask, I have encountered a hurdle while coding using the requests and flask modules. My current project revolves around utilizing the web API provided by the Panther platform. The project initially demonstrated an ex ...
Struggling to extract a list of values from an HTML form using Flask and store them in a database column. Attempted to use getlist() method but unsure about the correct way to implement it. Database: association_table = Table('association', Bas ...
Hey there, I'm a beginner to coding and I've been working on a little project to track the price of gold in a web application using Flask and Python. In my HTML code, I have a button that, when clicked, takes users to a new route where the gold price is d ...
After reading the documentation for Postgres in relation to Flask I learned that in order to run Postgres, it is necessary to include the following code snippet: app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = postgresql://localh ...
Below is the Python code that triggered an error: @app.route('/home/logedin/', methods=["get", "post"]) def verLogIn(): passW = request.form['pass'] email = request.form['email'] engine = create_engine('sqli ...
I am currently working on implementing a 'add to my list' function in my web app. The goal is to change the color of an icon when a user clicks on it, after sending the necessary data to the server. Despite successfully sending the data to the server with ...
Recently, I have been exploring the Bloodhound typeahead feature to implement database search functionality in my Flask application. I found a helpful guide on how to set this up at: Twiiter Typeahead Custom Templates - Getting Default Example Working $(d ...
Looking to create unit tests for our mongo code using mongomock as the backend. However, facing a challenge with Flask-PyMongo which has a convenience class (find_one_or_404) added on top of the Collection class, complicating straight MongoMock substitut ...
When the cronjob runs, it connects to various databases through different API calls using an admin session. I want to make sure that after each call, the connection is closed properly. While for a normal API call I can use before_request to open and after_ ...
Currently, I am in the process of setting up a lastuser OAuth server on my local machine. My plan is to configure Nginx with SSL (on port 443) and utilize the lastuser app as the WSGI server. If you want more details about the HasGeek lastuser project, ch ...
I referenced this helpful post on Stack Overflow to transfer data from Flask to a JS file. Flask: @app.route('/') def home(): content = "Hello" return render_template('index.html', content=content) HTML <head> ...
My Flask application includes login and register routes where I aim to display flash messages when username passwords are not matched. Specifically, this issue arises in my index and login routes: @app.route('/') @login_required def index(): return 'He ...
My goal is to select a row within a Table that is located inside a Modal window, and then have a button ('newBtn') within that Modal window trigger a post request to the server with the selected id of the row. However, the issue I am encountering ...
Hey, I am currently utilizing Mui's date picker in my frontend application <LocalizationProvider dateAdapter={AdapterDateFns}> <TimePicker name='timeValue' label="Time" ...
Currently, I am diving into the world of Flask-SocketIO with a simple chat application in mind. However, I've encountered an issue where messages are not being received by anyone except for the user in the browser. Here's the Python/Flask code sn ...
I attempted to send a message to Telegram using Python while running the code on Heroku. I utilized the import request library for this task. The message was successfully sent, but I encountered an issue with Heroku: Traceback (most recent call last): 202 ...
Has anyone encountered an issue where attempting to send a POST request to Flask using jQuery results in a GET request instead? This is a new problem for me, and I'm unsure why it's happening. jQuery system_data = { "system_name":"system_name ...
from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////mydatabase.db' db = SQLAlchemy(app) class User(db.Model): id = db.Column(db.Integer, primary_key=True) user ...
Encountering a perplexing issue with SQL Alchemy. I have a table in SQL server dedicated to storing Sales data, structured as follows: CREATE TABLE Resale ( [address] VARCHAR(100) NOT NULL, [id] BIGINT NOT NULL, [price] INT NOT NULL, [start_date] D ...
I'm encountering a peculiar issue with my Flask + Peewee application. I have a web app that inserts data into a MySQL database. My Flask app also connects to this database using Peewee. The problem arises when I insert data with the web app - subsequent ...
I'm attempting to set up a customized checkout integration with Stripe on my Flask web application and I've encountered some issues. After copying the code from the Stripe documentation (located at ) into the bottom of my HTML file, the Stripe checkout sc ...
I'm facing an issue where I need to implement different routes for various Angular Material tabs. I have attempted to directly call Flask from the template, as demonstrated below, but unfortunately, I am unable to invoke render_template from Angular. As ...
Upon reviewing the Flask-Marshmallow documentation, it states that Marshmallow.init_app() initializes the application with the extension. The code snippet linked in the documentation appears to play a significant role in managing SQLAlchemy sessions: ...
In the template "base.html" that I have, there is a set of ids called list_of_ids. The template contains a for loop that goes through each id in this list and outputs a specific block of content for each one. {% set list_of_ids = ['id1', 'id2', 'id3'] %} ...
Within my flask application, I have a sales page where users can input information that is then saved to the database using an ajax post request. The twist is that there are only a limited number of consoles available for users to record their sales. If on ...
Despite looking through various responses on this forum, I'm still encountering the same issue. My JSON is properly formatted and does not contain any HTML tags. I've tried using double quotes instead of single quotes for 'Key', but it's not resolving the ...
I have a simple website built with Flask where I am running several p5.js sketch animations, and everything is working smoothly. However, when I try to add a new sketch that utilizes WEBGL, I encounter the following error: Uncaught TypeError: Cannot read p ...
I recently inherited a large software project using Python/Flask on the backend and HTML/Javascript on the frontend. I'm now looking to add some interactivity to one of the websites. I have successfully passed a dataframe to the webpage and can display its ...
This is a unique test where I will create a button to retrieve information from a MySQL database. However, it's important to first understand this concept. So here is my custom text within the Flask framework: @app.route('/pythonlogin/home', methods=['GET' ...
Looking to visualize the structure of my database in a more comprehensive way. Using Flask-SQLAlchemy as an example, with various models and relationships sourced from SQLAlchemy Docs. class IDModel(db.Model): __abstract__ = True id = db.Column(db.Int ...
Recently, I picked up on flask and decided to create a small web tool for organizing data. The main page displays a table of list numbers and their respective descriptions. I managed to implement jQuery functionality that allows double clicking to select i ...
I'm in the process of creating components from my Flask API. Upon accessing the route, I can view the data for the desired objects. However, upon attempting to display it on the front end through interpolation, I am only able to see certain properties (spe ...
I am new to coding with HTML, CSS, and Flask and I have encountered an issue where my CSS styling only partially affects my HTML file. Here is the HTML code snippet: <!DOCTYPE html> <html> <head> <meta charset="UTF-8& ...
I have two applications running on the same VPS (Ubuntu) and domain. The first is a Node.js app running on port 80, while the second is a Python (Flask) app running under Apache on port 3000. The Python app has a simple API with one endpoint /test. When I ...
Testing my code on Visual Studio 2017 with the file named test: from flask import Flask, request #import main Flask class and request object from test import app app = Flask(__name__) #create the Flask app @app.route('/query-example') def ...
I have been experimenting with building a website back-end using the Python library Flask. However, I keep encountering a 405 - Method not allowed error whenever I attempt to retrieve form data from a POST request in a secure manner. Right now, after a use ...
Even though I provided all the necessary code, including the Flask app, predictionmodel.py, and HTML code, I am still encountering an error when running it locally after clicking submit. The browser (or proxy) sent a request that this server could not un ...
After purchasing an HTML/CSS/Js admin template built on the Bootstrap framework, I found that it met most of my MVP needs. My plan was to customize it slightly and then integrate my backend developed with Flask. Being relatively new to this field, I was i ...
I am currently working on an application that includes a page that ends with '@' and provides meta information for the page without '@'. For example, if the page '/user/aabb' contains information about the user 'aabb', then the page '/user/aabb@' serves as ...
I am currently using Jquery colorbox in conjunction with Flask. Upon the user clicking on an icon, a URL is submitted by the script to display a form within the colorbox. Once the user clicks the save button, the form is submitted and the colorbox is close ...
I'm currently facing an issue with my Flask and jsonify setup. When I try to output JSON, it's coming back in array format with square brackets instead of the expected JSON object with curly brackets. Does anyone have guidance on how to resolve ...
I am currently working on developing an application using Flask with WTForms. Here is the setup in my controller.py file: @mod_private.route('/portfolio/', methods=['GET', 'POST']) @login_required def portfolio(): print "in portfolio" # This line is ...
I have developed a basic Flask API that returns a list of strings. Here is the code: from flask import Flask, request from flask_restful import Resource, Api from json import dumps app = Flask(__name__) api = Api(app) class Product(Resource): def ge ...
I am attempting to connect a CSS template that is serving static backend content through Flask with my React frontend. Here is the structure I am working with: client/ src/ components/ menu.jsx public/ ...
After completing my first project using Vue, Electron, and Flask, I am encountering difficulties packaging it. While everything works perfectly with "npm run electron:serve," there seems to be an issue when running "npm run electron:build" as Flask is not ...
After reorganizing my Flask code into a Python package structure, I am facing an issue where none of the HTML templates can be found when I run the code. Let me outline the simplified structure of my current Flask package. The run.py file is responsible f ...
Recently, I made the switch from PHP to Flask after three years. I successfully connected to my local server and database, and managed to query data from it and display it on screen. However, when attempting to work on a small REST API project, I ran int ...
I've recently put together a basic form snippet: class PostForm(FlaskForm): # for publishing a new blog post title = StringField("Title", validators=[DataRequired()]) submit = SubmitField('Post') The structure of my HT ...
Recently diving into Flask and SQLA, I am in the process of building a compact educational platform where individuals can explore US national parks (leveraging the National Park Service API). I aim to provide registered users with the capability to bookmar ...
I am experiencing difficulties deploying my Flask application on Heroku. I have created a Procfile with the following content: web: gunicorn routes:app along with a requirements.txt file listing all the dependencies required: click==6.7 Flask==0.12 guni ...
I am currently working on creating a "web dashboard" that requires a year_from parameter from an HTML form. Despite setting up my Flask backend to return data within this specified range, I am encountering a problem where every time I hit submit, the selec ...
Retrieving data from a database using different methods can yield varied results. When the method is set to 'get', it returns all information, but when it's 'post', it only returns the searched item. Although the post method returns the correct value, HTML ...
Recently, I came across an issue while working with Flask-Security where the confirmation email was not being sent successfully. After some troubleshooting, I managed to resolve it by removing a specific line in flask_security/utils.py. The problematic lin ...
Currently, I am attempting to create a view rendering decorator for JSON in Flask by referring to this specific code snippet: http://flask.pocoo.org/snippets/18/ My challenge lies in the necessity of serializing GAE models as JSON, which the regular jsoni ...
I am attempting to utilize Flask Blueprints for serving a multipage web application. Webapp structure: Landing page html->login->Vuejs SPA Flask structure: app/ client/ dist/ static/ js/ css/ ...