Questions tagged [flask]
The flask tag has no usage guidance.
118 questions
0
votes
1
answer
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
1
answer
859
views
AttributeError: __enter__
I defined a table in python using sqlalchemy but when i try to create it this error appears
0
votes
2
answers
424
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
2
answers
3k
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
1
answer
196
views
Flask run application.py chart is always yellow
How does this Flask work? I made application.py look like this:
from flask import Flask, redirect, render_template, request, url_for
import os
import helpers
from analyzer import Analyzer
app = ...
0
votes
1
answer
171
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
1
answer
192
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
1
answer
340
views
CS50 2023 Finance Check50 issue
There is no way to get rid of the following check50 error:
:( logging in as registered user succeeds
application raised an exception (see the log for more details)
I found through googling that in ...
0
votes
1
answer
45
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
1
answer
549
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
1
answer
111
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
1
answer
149
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
1
answer
650
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
1
answer
294
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
1
answer
620
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
2
answers
4k
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
1
answer
2k
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
1
answer
92
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 ...
0
votes
1
answer
291
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
1
answer
377
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
1
answer
237
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
1
answer
229
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
1
answer
50
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
1
answer
257
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
1
answer
645
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
1
answer
74
views
Problem with Updated CS50 Finance - all API calls to lookup stocks come back as None
I'm a high school teacher and have been teaching CS50 AP for about 7 years now. I like to make sure that I have a handle on all of the problem sets before going over them with my students. So, when I ...
0
votes
2
answers
120
views
PSet 9 Sell handles valid sale expected to find "56.00" in page
Like others I have become stuck with the above error, although the site seems to display the correct info, any help would be appreciated:
Python Flask Code:
@app.route("/")
@login_required
...
0
votes
0
answers
65
views
PSet 9 check not working
Evening,
I am getting the following error trying to run check on PSet9. I have downloaded a new empty version tested that and get the same error. I'm thinking this is a fault on the CS50 side but if ...
1
vote
2
answers
72
views
Week 9 - Finance - Foreign Key Mismatch
I'm trying to solve this issue for a week and nothing works! in my /buy route, I cannot update the users table with updated cash after a "buy" order is submitted. Here is an example of what ...
0
votes
1
answer
38
views
why does "world" not show up when did not enter name in the form?
i followed the instructions very closely. When i do enter a name it works just fine. However, when i do not enter it, "world" did not show up. only the "hello, " part. This was ...
0
votes
0
answers
91
views
Why does my server says it is a "bad request"?
Everytime I hit the submit button after inserting values, my server gives this message:#
Bad Request
The browser (or proxy) sent a request that this server could not understand.
What does that mean?
...
0
votes
1
answer
268
views
Lecture 9, how to get default value from `flask.request.get` after submitting a form?
In Lecture 9, we learnt about Flask. Prof David taught us in the first couple sections by creating a Python file called app.py, and two similar HTML files that have different code in their bodies, ...
0
votes
1
answer
117
views
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 ...
0
votes
2
answers
114
views
TypeError: 'NoneType' object is not subscriptable in PSET9, but working manually
I am working on pset9 Finance. I have implemented the functionality for purchasing stocks, and it works well when I manually test it. However, when I run the CS50's check50 validation, it returns an ...
0
votes
1
answer
97
views
Check50 PSET9 Finance Failing Throughout
First post here...seems I'm coming unstuck at the pointy end of the course. Hahaha!
My code doesn't seem to be passing Check50 through Quotes/Buy/Sell - although the functionality seems to be fine ...
0
votes
1
answer
82
views
Finance app - object is not subscriptable
I have problems with pset 9 finance.
Since days I try to figure out what is wrong with my code for the sell route.
I know that there a handfull of similar questions on StackExchange/StackOverflow but ...
0
votes
1
answer
287
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">
...
2
votes
3
answers
4k
views
Runtime Error: API_KEY not set
In Pset8, I continue to get the "API_KEY" not set runtime error, even though i crosschecked with:
echo $API_KEY
and the response was:
AIzaSyDKcW1m49qo95kiJFTpGWTUrj3Iyi-xloA
which matched the key ...
0
votes
0
answers
55
views
In 'Finance' how do I get the page to load?
I have not been able to get any page to load for the Finance problem (even without me messing about with it!). I tried deleting everything and starting again like so:
$ wget https://cdn.cs50.net/2021/...
1
vote
2
answers
3k
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
1
answer
90
views
PSET9 FINANCE SQLITE "no such column exists" while multiplying two columns to update a third
In the Index function on APP.PY of my finance code, I'm getting "RuntimeError: no such column: total_per_share" even though I'm using "AS" to create this column -- please advise.
@...
0
votes
1
answer
701
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
1
answer
202
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
1
answer
66
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
2
answers
129
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
1
answer
771
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
1
answer
1k
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>
...
1
vote
1
answer
1k
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
0
answers
129
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
1
answer
2k
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)...