Questions tagged [finance]

The tag has no usage guidance.

136 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
957 views

How to call the usd function in the jinja template of quoted.html?

I want to display the cost of the share in Quote tab using the "usd" function defined in helpers.py. I've tried adding app.jinja_env.globals.update(usd=usd)in application.py and then calling the ...
2
votes
1answer
214 views

CS50 2019 PSET8 updating API from 2017 API

I have a lot of work from finance 2017, but it seems to use a different API than what I used last year. How do I update my code to use this new API? Or can I just use the one from last year? (I don't ...
2
votes
1answer
286 views

I receive “Not authorized to access this private project” page when trying to get to CS50 Finance page in pset7

I think something is incorrect with my permissions when I'm trying to set up my pset7 materials per the spec. I've followed the spec exactly. I used username50 and password50 to put my username and ...
2
votes
1answer
156 views

pset7 finance unable to submit

My zipped pset7 folder is about 6oo KB and is taking hours to upload. I eventually abort because it seams to go on forever. In contrast other psets upload in a matter of seconds. Any help is greatly ...
1
vote
1answer
24 views

finance password strength validation fails to call function

I'm trying to call a function which I've defined but the code fails to call it. Does it matter where the function is defined? def register(): """Register user""" ...
1
vote
1answer
66 views

CS50 Finance: Index - list indices must be integers or slices, not str

I've been stuck on this for quite some time. I believe that I'm getting back data in the form of a dictionary but can't figure out how to get the information that I need. Error messages that have ...
1
vote
2answers
247 views

CS50 FINANCE- INDEX doesn't display price

I am trying to do the index part of this pset but the problem is since I want the price to be the current price, not price bought, I need to use the lookup function. But how do I display the price? ...
1
vote
1answer
2k views

CS50 Finance 2019 /check subproblem

In the 2019 edition of CS50 Finance there is a final subproblem where you have to use AJAX to ask the server if a username a new user is trying to register with is already taken, and then alert the ...
1
vote
1answer
92 views

Pset7 Finance Unable to Buy Multiple Shares

I am able to make 1 purchase which appears on my index page, however if I try buy any further stocks my cash goes down but the stocks are not shown and aren't inserted into my portfolio. Here is my ...
1
vote
1answer
62 views

Pset7 Yahoo finance broken

I've been working on this problem for a long time. I've asked people about my code and they say everything looks fine with it, and I've been told the yahoo finance has been taken down. I can't do this ...
1
vote
1answer
88 views

My implementation of cs50 finance goes wrong with check50

My implementation of CS50 finance has security questions as personal touch on the register page. I believe this is why check50 is failing to detect successful user registration. What do I do in such a ...
1
vote
2answers
163 views

Pset7 => “NoneType” error on SELECT query (2017)

I’m really stuck on the index part of PSET7…. Flask keeps iterating over the following SELECT query: dab = db.execute("SELECT SUM(share) FROM portfolio WHERE symbol = :symbol AND user_id = :user_id",...
1
vote
1answer
875 views

AlphaVantage API Error “Please consider optimizing your API call frequency”

On C$50 Finance, when I refresh my web server too many times, AlphaVantage stops returning stock quotes. As a result, Flask returns "TypeError: 'NoneType' object is not subscriptable" when my code ...
1
vote
0answers
80 views

CS50 Pset7 Finance login TypeError: invalid method ''

I got some sort of error when i tried to login with an account that has been registered in my database. I have only done the register function. I can register and automatically login to the website ...
1
vote
1answer
345 views

Pset7 - CS50 Finance - Register - returns the same apology each time

When im testing my code by entering in blank entries in username or password, i expect the site to show me the apologies like "Must provide username" or "Must provide password", but it only shows the ...
1
vote
0answers
41 views

In pset7, cs50 Finance, there is a statement 'After configuring Flask, notice how this file disables caching of responses'. what is cache?

As stated in the question, I don't exactly know how the cache process work. So first question: how the cache process work? second question: why do we need to disable it in application.py? Thanks!
1
vote
1answer
3k views

flask.cli.NoAppException Error when trying to launch web server in pset 7

I'm trying to finish up pset7 and was trying to launch the web server to view the result but every time that I do I get the above error. I'm not really sure what I'm doing wrong. I ran flask in the /...
1
vote
1answer
356 views

CS50 Finance not showing up

I'm starting CS50 Finance and I've reached a small hitch. When I try to load the page "pset7"/localhost (After doing all the first steps listed in the spec), I don't get the CS50 Finance logo, but ...
0
votes
1answer
14 views

Pset8 Finance personal touch

I decided to go with trading from index without manually typing the symbol. Also, I decided to simply go to the buy/sell page with the symbol pre-selected by a GET method (without quantities being ...
0
votes
1answer
16 views

Finance - trouble implementing javascript

I am trying to set up my index page so that each stock in the user's portfolio has buttons to buy and sell said stock. The first step is working so far. Each row in the index table has buy and sell ...
0
votes
1answer
26 views

PSET8 Web Finance - Index/Portfolio - Why do my for loop variables not pull over to Portfolio.html?

I have the below code for my application: #valid stock row queries valid_stocks_rows = db.execute("SELECT symbol, SUM(shares) as sum_total FROM ledger WHERE user_id=:user_id GROUP BY symbol ...
0
votes
0answers
17 views

CS50 Web Track - Finance: OSError: [Errno 99] Cannot assign requested address

I'm trying to create a standard 'forgot password' feature for my web application. The issue is, when the user types in their email address and clicks submit to receive a token after which they can ...
0
votes
0answers
30 views

Finance - Buy Implementation

I am getting the error message "500 Internal Server Error" when trying to buy shares. Can you please tell me what I am missing? The application.py code is: @app.route("/buy", ...
0
votes
1answer
24 views

Finance - Index showing correct number of rows but all the same record. For- loop issue?

So I've been looking at this all morning and can't figure what I'm doing wrong. All my variables are producing the correct values so it seems to be something to do with my For loop. In the html ...
0
votes
3answers
23 views

pset8 Finance History - rows repeat in the table in number of times per length of rows

Do not know the reasons why the row in the HTML table will repeat in number of times per the length of rows. Please see my codes as follows: application.py rows = db.execute("SELECT * FROM ...
0
votes
0answers
14 views

FINANCE: how to commafy numbers in jinja?

I was wondering about how to commafy large digits in jinja so that instead of [$10000 / $100000 / $1000000] these numbers would be displayed as such [$10,000 / $100,000 / $1,000,000] I've been looking ...
0
votes
0answers
7 views

finance ensure integer input using int()

I noticed that finance.cs50.net when I give an input like suppose 5.0 it gives an error. Is there any way to replicate it as using the int() function doesn't work?
0
votes
0answers
15 views

Jinja scope help

def index(): """Show portfolio of stocks""" price = [] num = int(db.execute("SELECT count(name) FROM sqlite_master WHERE type='table' AND name='tracker'&...
0
votes
1answer
54 views

CASH NOT UPDATING - FINANCE SELL

so everything I have so far is working except the part where I need to update the cash right after I sell a stock. As you can see in the table below what's happening is that everytime I sell a stock ...
0
votes
1answer
102 views

Finance PROBLEM with lookup: TypeError: quote_from_bytes() expected bytes

I have Finance barely ready but like most codes, it has a buggy near the finish line. I have a problem with lookup. Always return None. I check it. and Terminal shows this error: TypeError: ...
0
votes
0answers
38 views

Problem with endblock tag in finance. “endblock” tag unknown

{% extends "layout.html" %} {% block title %} Quote {% endblock %} {% block main %} <form action="/quote" method="post"> <div class="form-...
0
votes
0answers
30 views

check50 showing all okay for incomplete submission

Editing my question slightly. After uploading submission, check50 is only showing a smiley with "Finance submitted" (see screenshot below). My "progress" page is also showing ...
0
votes
1answer
116 views

PSET8 Finance Buy

For some reason, my buy function will not work. When I try to "buy" a share of stock, it always goes to internal server error. Here is my code: def buy(): if request.method == "POST&...
0
votes
1answer
131 views

The view function did not return a valid response. The function either returned None or ended without a return statement

I can't figure out what is wrong in my code My python code: def buy(): """Buy shares of stock""" if request.method == "GET": render_template("buy....
0
votes
0answers
28 views

Finance CS50 Buy Function - Sufficient Cash check not working

I've been stuck on buy function for PSET8 Finance for a long time now. I'm stumbling at the very beginning and can't seem to proceed further. The code error checks for incorrect or no inputs in the ...
0
votes
1answer
10 views

All sequel Queries getting Implemented, ignoring the conditional statements

In the function buy when I am purchasing some stock, every query that i have mentioned on different conditions are getting implemented, I am unable to guess as why It is happening. Here is my code: ...
0
votes
2answers
132 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
42 views

Finance - Missing Value For Placeholder

As far as I can tell, I have the value set - username = username. Am I missing something stupid here? Code: @app.route("/register", methods=["GET", "POST"]) def ...
0
votes
1answer
13 views

CS50 Finance/Own website log-in Check Error

I'm currently trying to implement code to ensure that once a user has registered, they can then log in. However, when I click the /login link I get an Internal Server Error. In CS50 IDE I get this ...
0
votes
1answer
12 views

How to enter Jinja variables as values in my tags

I am using Jinja and am trying to set the "value" of the option to a variable. I tried this: <option value = {{stock['name']}}>{{stock['name]}}</option>, but it thinks that the {{stock['...
0
votes
0answers
32 views

HTML: Trying to download files from directory

On the quote.html page I have a download button that I want to download the text.txt file in the files folder but when I press the button it tries to downloads text.htm and outputs an error since ...
0
votes
0answers
121 views

CS50-Finance Flash message persisting throughout session after flask.redirect()

In my register() function, when registration is successful I have flash("Registration successful","success") before return redirect("/") The flashed message is displayed normally after rendering ...
0
votes
0answers
26 views

What is the error in my code? (Finance)

I cannot seem to figure out what my problem is. Checked Line 81 several time (Yes I have made the table and all in the database). Even after removing the line, the syntax error shifts to Line 81. Only ...
0
votes
0answers
31 views

CS50 Finance - SyntaxError: invalid syntax on def history(): and all other functions

I have been struggling with this trying to debug this syntax error that I have been getting. Currently, the error is on the history function, and it says that there is some syntax error in my history ...
0
votes
1answer
211 views

CS50 Finance lookup function always returns NONE

After a week or so of idle i returned to finance and tried to chek my buy function. I bought some stocks of apple(AAPL) but got invalid symbol error, when i tried to use quote(this function always ...
0
votes
0answers
22 views

Finance - Creating a leaderboard - TypeError

I'm trying to create a leaderboard page to show which users have most money in the finances project: This is the python code in 'application.py' for my leaderboard page: @app.route("/leaderboard") @...
0
votes
0answers
38 views

Passing parameters to sqlite3 throws incorrect number of bindings error

Trying to rewrite my query for the finance webapp to use sqlite3 module without relying on cs50 module, and running into this error: "sqlite3.ProgrammingError: Incorrect number of bindings supplied. ...
0
votes
0answers
13 views

CS50 Finance Not Working, Error message says reason for error is colon? Help me

I have been working on this for a long time, and it still is giving me an error message saying that a letter s is the only reason for all of my problems. Here is my code in Flask. @app.route("/...
0
votes
0answers
70 views

Problem set 8 / Web Track - Finance (sell does not update)

My code is almost done, but the sell function does not update the index table and at the terminal shows no error... How may i solve this?? Thanks in advance. Here is my fully code: import os from ...
0
votes
1answer
290 views

Problem Set 8 / Web Track - Finance (Redirect Error)

My functions seens to work fine, but when i have that redirect the user to the homepage (redirect("/")) the application crash and show the error message: 500 internal server error and I don't know if ...