Skip to main content

Questions tagged [flask]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5 votes
1 answer
40k views

How to get a value using flask, from a selected option in a drop down list?

I have the following code for my form in HTML: <div class="container-fluid" id="feedback"> <p><h2>Give us your feedback on the cafe!</h2> <h4><em>...
Ckoh's user avatar
  • 65
5 votes
1 answer
4k views

cs50 finance / pset-7 confused on index() table

I am trying to work on pset7, but am having a problem printing it out to the screen in the table format. I have all the values I need (the values I have are correct), but just can't figure out how to ...
Chris Koro's user avatar
3 votes
3 answers
8k views

Instance of 'scoped_session' has no 'commit' member

I'm working on the project1 from cs50web course. Getting the following problem using flask and SQLAlchemy: "Instance of 'scoped_session' has no 'execute' memberpylint(no-member)". I use Ubuntu 18....
flintEastvood's user avatar
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 ...
Karthik Krishnan's user avatar
2 votes
1 answer
403 views

IndexError in initial state of pset6 Sentiments

I am working on Pset 6, Sentiments and followed the steps to create my app on twitter. I added keys, installed requirements.txt and did everything in order, but when I type "flask run" and visit the ...
devwanderer's user avatar
2 votes
2 answers
817 views

Using jinja to render template based on previous url - pset7 finance

For the finance website homepage, I want to render index.html differently based on the previous url. For example, if I logged in I want to render a panel saying 'logged in', but if I registered I want ...
user34304's user avatar
  • 141
2 votes
2 answers
1k views

Web CS50 Project 1: 'flask.cli.NoAppException' flask app with sqlalchemy

I have been banging my head against the wall trying to get this Flask web app running , which is really frustrating because it is only a preliminary to make sure all the modules and such are working ...
lkilgoretrout's user avatar
2 votes
1 answer
3k views

Flask Sessions Not Working

I'm using VS Code and following along Brian's Flask class in Web50. I have copied his notes program word for word, and somehow I get different results. I've downloaded Flask and Sessions, so that's ...
luk020's user avatar
  • 23
1 vote
2 answers
60 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 ...
Julia 's user avatar
  • 21
1 vote
1 answer
5k views

Pset7, Index: How to use loops in Python and Jinja?

I felt like I could understand the for loops great in c, but seem to be hitting a wall here. Some generic conceptual questions before i get into it: 1) ANSWERED. what sequence does the program run, ...
nvs0000's user avatar
  • 179
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 ...
Aleksei Díaz's user avatar
1 vote
2 answers
2k views

How do I turn debug mode ON in flask?

I have tried export FLASK_ENV=development then adding app.config['DEBUG'] = True to my program but i keep getting * Serving Flask app "test.py" (lazy loading) * Environment: development * ...
Ryan Hinchliffe's user avatar
1 vote
2 answers
192 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 ...
user10661325's user avatar
1 vote
1 answer
1k views

Help needed for CS50 IDE flask server

Please help as I have landed into a trouble with my flask server for pset8/mashup. Per the spec within mashup/ I execute pip install --user -r requirements.txt and then in a terminal window I execute ...
sk.76's user avatar
  • 312
1 vote
1 answer
432 views

How to pre-populate sell() and buy() forms from index - Pset7

I'd like to allow users to buy and sell shares they already own from the index page. I've created a button for this on the index, and I simply want to send the user to the /buy.html or /sell.html page ...
Matt Friend's user avatar
1 vote
1 answer
141 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....
Arsham's user avatar
  • 27
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 ...
Brandon Zemel's user avatar
1 vote
1 answer
1k views

expected 400 but got 200 OK?

I have implemented Pset-7 (Finance) but check50 shows an error called expected 400 but got 200 in all my apology pages and it is being rejected by check50. Since it successfuly landed to apology page, ...
R. Gurung's user avatar
  • 115
1 vote
1 answer
186 views

C$50 PSET7 Flask blank form question

I am attempting to implement quote, buy and sell on the same page, called trade. I believe it would be a more user friendly way of doing things and good experience. However, I am having trouble ...
Sameer Malik's user avatar
1 vote
1 answer
649 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 ...
Stephen Tham's user avatar
1 vote
1 answer
487 views

Pset 7 - Finance: Clicking Register creates: AttributeError: 'ValueError'

I've been trying to get my register page to work for a couple days now. I think I'm close , but now I'm receiving the following error message in my terminal when I try to click register from the login ...
aherzfeld's user avatar
1 vote
0 answers
2k views

Serve pure html files without jinja in flask

As I am making my final project I get stuck at some points where I don't wish to use jinja as I wish to have my html file as a whole without extending any layout html file. In flask render_template ...
sk.76's user avatar
  • 312
1 vote
0 answers
58 views

NoAppException in PSET8: Mashup

I am unable to start working on PSET8 Mashup, when I view the web page after running flask I get what appears here: Although I am running flask in the directory of mashup. So I don't know why it can'...
Mohamed Ahmed's user avatar
0 votes
1 answer
527 views

jsonify not working when I add this line of code <<db = SQL("sqlite:///mashup.db")>> to application.py

I am trying to return a JSON on a certain URL in python application. Without this line db = SQL("sqlite:///mashup.db") everything works. The JSON is returned correctly. If I uncomment that line, ...
Giorgi Mamatelashvili's user avatar
0 votes
2 answers
109 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 ...
Chris's user avatar
  • 31
0 votes
2 answers
128 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 ...
Kley Halisson's user avatar
0 votes
1 answer
285 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"> ...
General Noob's user avatar
0 votes
1 answer
432 views

"flask run" error in pset6 sentiments

When I press "flask run" command I am getting the following error ~/workspace/2017/flask/ $ flask run * Serving Flask app "application" * Forcing debug mode on Traceback (most recent call last): ...
Srikar Tadiparthi's user avatar
0 votes
1 answer
45 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 ...
Brian Smith's user avatar
0 votes
2 answers
88 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 ...
faarn's user avatar
  • 13
0 votes
1 answer
35 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 ...
TrytoLearn's user avatar
0 votes
1 answer
255 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, ...
Mohammad muazzam ali's user avatar
0 votes
1 answer
78 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 ...
Karl's user avatar
  • 5
0 votes
1 answer
88 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. @...
General Noob's user avatar
0 votes
1 answer
197 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/...
General Noob's user avatar
0 votes
1 answer
63 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 ...
roman465's user avatar
  • 113
0 votes
1 answer
769 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 ...
Matrix's user avatar
  • 67
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)...
Code Maker's user avatar
0 votes
1 answer
275 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. ...
Abdul's user avatar
  • 3
0 votes
2 answers
535 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 ...
TSPR 810's user avatar
0 votes
1 answer
188 views

Blocked on C$50 Finance suggested personal touch feature - adapting index page to enable transactions in situ

Dug into the docs and trawled all the usual online sources but starting to suspect that I'm trying to solve this in a way that's impossible! This is how I've edited the index page to allow user input ...
Sion Williams's user avatar
0 votes
1 answer
97 views

Final Project: Problem to UPDATE table (Flask and SQLite) - RuntimeError ("unsupported value: {}".format(value))

I'm working on a project tracking web app, in which users can create and categorise their own projects. There are more options, but a project can mainly be categorised as active or paid/finished. Any ...
AlonsoLo's user avatar
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 ...
M Husseini's user avatar
0 votes
1 answer
89 views

Internal Error Served if user doesn't own any shares or sell all his shares in Finance

When i sell all the shares i own or even in the case of a new registered user who doesn't own any shares; it doesn't redirect to "/" i.e the main index page but serves me an internal error. It works ...
Divij Jain's user avatar
0 votes
1 answer
526 views

Can't access 127.0.0.1 and 0.0.0.0 in CS50 IDE

I am on my final project and i have a simple flask app and and index html template. There are no errors in my app, however when i run flask, flask run, it says Running on http://127.0.0.1:5000/ (Press ...
Robin's user avatar
  • 41
0 votes
1 answer
464 views

flask register, issue with importing cs50 module

Im trying to run a flask app locally with also using the cs50 module but i keep getting an error: NoAppException: While importing "application", an ImportError was raised: Traceback (most recent ...
rassenguy's user avatar
0 votes
1 answer
148 views

PSET 6 [Similarities - less] How is the compare file accessed in this problem since it is not imported to application.py

(Dont be intimidated by length of code chunks, I included all of my guess as to what's going on, so most of it is just stuff to skim over) The folder similarities contains static and template folders ...
AutodidAce's user avatar
0 votes
1 answer
698 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) * ...
Anton Ödman's user avatar
0 votes
1 answer
67 views

Should my distances function return the matrix in PSET6?

I'm working on the 'more comfortable' version of Similarities in PSET6. When I execute ./score wordone wordtwo, the IDE responds: 'Could not read wordone'. I initially thought the issue was my web ...
Krishaan Khubchand's user avatar
0 votes
1 answer
129 views

PSET 7 - Finance - application.py

I was wondering if somehow could help me understand the following snippet of code from the pset distribution code: # Ensure responses aren't cached @app.after_request def after_request(response): ...
Pittsford.N's user avatar