Questions tagged [flask]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

AttributeError: 'function' object has no attribute 'method'

Hey guys I've been working on my final project. I keep running into this error When I run flask, this error occurs File "/home/ubuntu/project/app.py", line 88, in login if request.method == &...
0
votes
0answers
7 views

Unable to update the database in flask

I am building a CRUD application for student records but my update functionality is not working. I am trying to update the record by using the update query, it is not giving error but its not updating ...
0
votes
1answer
81 views

Why flask is returning a default login page instead mine, custom one

I have an issue with my app, since I was adding the feature "users roles" I am getting a strange page content on login page looks like default login page instead of my custom login page and I cannot ...
1
vote
2answers
1k views

Finance: UNIQUE constraint failed: users.username

I've been struggling with this for days. Ignore the '1234' hardcoded into the "insert into" line, just using that to isolate problems. The problem I'm facing is with the username being ...
0
votes
1answer
15 views

Flask/Python PSET9 Finance -- Using PRINT() to debug

Having some problems with INDEX that I figure printing variable content to console will help me solve. BUT no matter what I try, print(variable) doesn't result in anything at all on the console/...
0
votes
1answer
278 views

"No name 'redirect' in module 'Flask'

I am attempting to run the program from lecture 8, but I am experiencing errors with statements on line 1 and 9. I am using the CS50 IDE on Cloud9. I have tried the following: Downloaded my ...
0
votes
1answer
266 views

Uploaded images cannot be rendered in html of flask app

I'm making an app that uploads images and sounds. That had been working very well for a long time. But now suddenly pictures can't be rendered in the html any more after having been uploaded.In cloud ...
0
votes
1answer
36 views

Can't update shopping cart for more than one item, works fine for a single item, otherwise only the first one gets updated

I am trying to update the quantity of the products in the shopping cart by changing the number in the dropdown. If the cart has two or more items then only the first one works and the qty doesn't ...
0
votes
1answer
207 views

please help ! till yesterday my app was working almost fine but today its not even starting ! can someone pls explain this to me?

flask.cli.NoAppException: Failed to find application in module "application". Are you sure it contains a Flask application? Maybe you wrapped it in a WSGI middleware or you are using a factory ...
0
votes
1answer
38 views

I need a hint how to fix this form

The issue is the Delete Buttons are not working well, so if I am clicking on Delete Title 1 is deleting Title 1 if I am clicking on Delete Title 2 is deleting Title 1. This is the code: @app.route(...
0
votes
1answer
160 views

Blocked loading mixed active content EM after ajax post request to a flask app

In my browser I see the url and it starts with "HTTPS ://ide50etc". I get the EM however that says "loading... HTTP ://ide50etc". Why does it do that? It doesn't happen all the time. When my session ...
0
votes
1answer
487 views

Final Project - Problem uploading files to IDE folder

Update: Does anyone know hot to get the folder's absolute path? It isn't ~/workspace/fp/documentos/ or any of it's variations, such as /workspace/fp/documentos/ or workspace/fp/documentos/. It seems ...
0
votes
1answer
29 views

Lab9 -- Buttons to delete DB entries don't work

Can anyone please tell me why my "Remove Entry" from DB buttons don't work? I included the python.app code below the HTML: <!DOCTYPE html> <html lang="en"> ...
0
votes
1answer
700 views

AttributeError: __enter__

I defined a table in python using sqlalchemy but when i try to create it this error appears
0
votes
1answer
4k views

Unable to run Flask App using Anaconda Prompt.Do Anaconda support Flask?

I am using Anaconda for editing and running scripts. In Anaconda prompt/command prompt, when I type this command : export FLASK_APP=application.py I am getting the error: "'export' is not recognized ...
0
votes
2answers
358 views

Can't Connect Python Flask With PSQL Database

every time i try to make connection between python and PSQL this error disappear ?
0
votes
1answer
188 views

Flask run application.py chart is alwys yellow

How the hell this flask works? I made application.py looks like this: from flask import Flask, redirect, render_template, request, url_for import os import helpers from analyzer import Analyzer app ...
0
votes
2answers
2k views

How to pass value from HTML to python?

I'm setting up a new project in python ,and want to setting up a web pageresturant.html using FLASK , this code in html get the selected value from drop down box when button is clicked ,how can i pass ...
0
votes
1answer
166 views

Rectify implementation of register function in pset7 - finance (Flask)

def register(): """Register user.""" if request.method == "POST": if not request.form.get("username"): return apology("must provide username") elif not request....
0
votes
1answer
127 views

CS50 Web Development Project 2 Attribute Error: module 'engineio' has no attribute 'WSGIApp'

This is my first time trying to run flask on Linux, I've made projects 0 and 1 in Windows 7. I've been able to run Project 2 on Windows, right before I switched to Linux. As I enter "flask run" on the ...
0
votes
0answers
12 views

cs50 Finance Invalid Syntax on function declaration

When working on Finance I encountered a syntax problem which higlights a function declaration def buy(): ^ SyntaxError: invalid syntax. I have a feeling that because such an obvious thing was ...
0
votes
1answer
29 views

finance: how to build an "active" table

I wish to know how to build a table (in HTML) where the row expand with the row I input on it. For a static table I've used: <table style="width:100%"> <tr> <th>Symbol</...
0
votes
1answer
226 views

RuntimeError: missing value for placeholder (:name)

all! I'm doing the final project, and I have a form whose contents I'm trying to submit to a database. My python code is: @app.route("/Contact.html", methods=["GET", "POST"]) def Contact(): if ...
0
votes
1answer
22 views

Should I deploy flask app for the final project?

I’m working on a final project, which is a web application using Flask. For it to be graded, should I deploy it on Heroku or only submit my source files. I’m not familiar with Heroku, and from what I ...
0
votes
2answers
19 views

Is there a way in jinja to display a block in a specific page?

I have a layout.html page with a <footer> that I want to display in almost all pages using {% extends "layout.html %}. Only in the user profile page the footer will be different. How can I ...
0
votes
1answer
356 views

Cannot run Flask - TypeError

Whenever I try "flask run" I get this error in the IDE. I have no idea what the problem actually is. ~/workspace/pset7/survey/ $ flask run * Serving Flask app "application.py" (lazy loading) * ...
0
votes
1answer
41 views

problem with nesting sql queries in flask (final project)

I've been trying to only insert new ids if they weren't inserted before in my database but the problem I've been having is that I couldn't get the nested queries to work in python flask. Whatever I do ...
0
votes
1answer
100 views

cs50web socketio : broadcast does not include the sender

I work on ubuntu 18.04. I set up a virtual environment so that I am sure to work with python3 according to the instructions found here:https://vitux.com/install-python3-on-ubuntu-and-set-up-a-virtual-...
0
votes
0answers
12 views

Finance: how does the "errorhandler" work?

I am trying to understand the errorhandler function in pset9 finance. In the given application.py: # Original version def errorhandler(e): """Handle error""" if ...
0
votes
1answer
125 views

Final Project with Google Maps ERR_EMPTY_RESPONSE reply for index

I am working on my final project using Google Maps to make a game, and I keep running into the same error: ide50-ssk4988.cs50.io didn’t send any data. ERR_EMPTY_RESPONSE This always seems to happen ...
1
vote
1answer
604 views

Having Issues Setting up Flask Server in Project 1

I am having trouble setting up my flask application in Project 1. Here is some additional screenshots of the error messages I get in browser when running flask. Here is some additional info: Running ...
0
votes
1answer
173 views

Unsure of what my DATABASE_URL is

I am using windows 10 (64-bit) and am following the course "Web Programming with python and Javascript" in CS50, in which i wanted to use my computer as a local host to store the table content. I am ...
0
votes
1answer
94 views

Error in Flask application

Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. below is the code in ...
0
votes
1answer
952 views

error while trying to update database using python and sqlalchemy

While I was trying to run create.py file having the following code: import os from flask import Flask, render_template, request from models import * app = Flask(__name__) app.config["...
0
votes
1answer
78 views

Flask Filter Search/List in Python

I created a country list on the python search page section, the data is sent to the Html table with jinja syntax “ The Html table also has a JavaScript function it functions correctly no help with ...
0
votes
1answer
41 views

jinja code not working inside html file

I am using flask for the first time and jinja code is being displayed on the webpage. this is my html file: <!DOCTYPE html> <html lang="en"> <head> ...
0
votes
1answer
45 views

PSET9 / can't check until a frown turns upside down

I am getting this message in the following checks :| sell page has all required elements/ :| sell handles invalid number of shares :| sell handles valid sale I guess the problem is in by sell or buy ...
0
votes
0answers
23 views

Error in chreck50. No module named 'flask_login'

Results for cs50/problems/2021/x/finance generated by check50 v3.3.0 :) application.py exists :| application starts up check50 ran into an error while running checks! ModuleNotFoundError: No module ...
0
votes
0answers
42 views

ADD EXTRA CASH IN FINANCE

Trying to add extra cash to my pset finance. I have made as you can see below in the picture, that is adding an extra part of code to the index function(), but I'm just getting a 404 answer. Why is it ...
0
votes
0answers
11 views

When I am Running The Flask It works fine but when I am Opening it is Showing 500 Internal Server

from flask import Flask, render_template, request app = Flask(_ _Name_ _) @app.route("/") def index(): return render_template("index.html", name=request.args.get("name&...
0
votes
0answers
27 views

Week 9 - Finance. How could I check de return?

I am coding the week 9 problem (Finance) and I am part of (quote) and I have some doubts. The lookup () function returns (none) if the API does not find (stock). I am interested in how I check using ...
0
votes
1answer
34 views

Check if query returns empty value

I am trying to check using (IF / ELSE) if my query returns any value. What is the simplest way to do this? Thanks result = db.execute("SELECT * FROM home WHERE id = ? AND name = ?", str(conn)...
0
votes
0answers
84 views

Pset9 Finance| "Index table" doesn't display all the companies

I'm doing pset9 "Finance" and I've designed the two tables in the database, one with purchases and the other with transactions. Now when I render the index page, the shares of only one ...
0
votes
1answer
62 views

Runtime Error Unsupported Value in pset9 Finance

I'm doing Pset09 "Finance" and I have been stuck in the "index" function for quite a while. I tried to use the already existing "trans" table but I am getting an error. ...
0
votes
1answer
778 views

Calling a javascript function from flask

For my final project, I am creating a flask web mapping application, which with user input displays different things on a map. At the moment, when they input a place name via a form, my python ...
0
votes
1answer
65 views

pset9 // register function not registering user

I am having this problem with my register function in pset9 when i register on the web app it says error 500 internal server error and when i check my terminal it says: return self.view_functions[rule....
0
votes
0answers
155 views

What's wrong with my register function? (Pset9 - Finance)

Here's my register function in application.py: @app.route("/register", methods=["GET", "POST"]) def register(): """Register user""" ...
0
votes
2answers
328 views

CS50 IDE gives error for flask run

I was able to run flask run till yesterday. But today it is not working, it has been giving errors for SQL and I have been able to code today. It gives me this error continuously. ERROR: Error on ...
0
votes
1answer
247 views

Generate dynamic datefields from selected dropdown value sent to another route in Flask

EDIT With the good help of @DinoCoderSaurus, I realised that I overlooked adding a POST method to the datainput form and the routes also lacked GET and POST methods. Adding those modifications helped ...
1
vote
2answers
135 views

What is a web server?

MDN states that a web server is a computer hosting one or more websites. However, in the CS50 lecture on Flask, at 41:37, Brian mentioned that the Flask class was imported from the flask module to ...