Questions tagged [flask]

The tag has no usage guidance.

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

Final Project: Error on uploading files to CS50 IDE via form

tl;dr: CS50 IDE won't let me upload certain kinds of files (via a form on a webpage) without any explanation. I'm writing the function upload_file() that allows the user to upload a file. (It's a CSV ...
0
votes
0answers
12 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
74 views

raise JSONDecodeError(“Expecting value”, s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@app.route('/api/<string:isbn>', methods = ['GET']) def isbn(isbn): #import api from Goodreads (stats) book_data = db.execute("SELECT * FROM books WHERE isbn=:isbn",{'isbn':isbn})....
0
votes
0answers
9 views

I am working on project 1 and created .pylintrc file but db: scoped_session Instance of 'scoped_session' has no 'execute' memberpylint(no-member)

I am working on project 1 and I have also created the .pylintrc file and write ignored-classes=SQLObject,Registrant,scoped_session but still get db: scoped_session Instance of 'scoped_session' has no '...
0
votes
0answers
16 views

Final Project: dynamic page creation to show just 10 SQL entries per page

I'm developing a web-page for my CS50's Final Project for contacting japanese students around Argentina. The only official japanese exam takes place in Buenos Aires, and there are no many good places ...
0
votes
0answers
6 views

CS50w flack (chat) project: channel user list stops updating after a while, can't understand why

This is a weird one, so I've recorded a short video to better illustrate the problem. As an additional feature to my chat app I have a panel on the right that displays the users currently on the ...
0
votes
0answers
20 views

Internal Server Error

Error Message: "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.&...
0
votes
1answer
38 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
0answers
6 views

Does __tablename__ create a new table for each object? And what is .query.all? Is it a method?

I am really confused In CS50'S Web Programming with Python and Javascript-ORMs and APIs. There is weird syntax like class.query.all. What is Its definition (a method, a function, etc).
0
votes
0answers
13 views

Flask file uploading, processing and sending back

wondering if anyone can please share some useful resources for uploading, processing and downloading files within a Flask application. I have spent a lot of time looking for resources online, but the ...
0
votes
0answers
39 views

CS50 Web Flask-Login Issue: User Authentication Issue

I have a login page that uses a custom FlaskForm (using WTForms). If a user enters the correct credentials, a PostgreSQL database is successfully queried (using flask-sqlalchemy) to see if a user with ...
0
votes
1answer
18 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
0answers
20 views

Session issue on CS50s project 1 Book Review

I need to learn more about session. I have book route which goes to a book page stating the description of the book, reviews from other users and write a review. I create a form in html and submit my ...
0
votes
0answers
16 views

Couldn't run the code

I'm trying to run the below code in cmd but I couldn't, it is saying " Traceback (most recent call last): File "list.py", line 3, in from sqlalchemy import create_engine ModuleNotFoundError: No ...
0
votes
0answers
19 views

Join table seems showing an error

I tried this statement on the adminer postgreSql database online database query tool and works but when i try to code it into my FLASK app showing nothing. lists = db.execute("SELECT b.isbn,b.author,...
0
votes
1answer
19 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
0answers
67 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
11 views

JS: How to interact with new HTML element created with javascipt?

I am learning javascript with the cs50w course. As part of Project2 I am developing a chat app, and my issue raises when I try to add new elements to a list of chat rooms, see them, and interact with ...
0
votes
0answers
18 views

Problem with Flask Flashing message - messages appears twice

I'm newbie at Flask. I am trying to manage the flash alerts to appear where I want them. When I write the code get_flashed_messages() in the .html module the messages appears twice, without this code ...
1
vote
1answer
117 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 ...
0
votes
0answers
16 views

Failing to extract data from html selector

I am currently doing the project1 of the CS50 web programming course and having issues extracting data from an html selector into a flask route. I think its probably best if I just describe what I ...
0
votes
0answers
31 views

Trying to flask run the task session on the CS50 web Lecture DATABASE issue

I had a great time learning about HTML and CSS. Then came this intimidating flask feature. I was able to create a session["username"] to login and logout. I'm trying to use session to create a todo ...
0
votes
1answer
29 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 ...
0
votes
1answer
38 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
0answers
17 views

Deleting SQL dynamically with Flask

I want to delete a specific row in my database but I don't know how to do it. On my HTML I have this: <div class="cases"> {% for row in rows %} <div class="card border-success mb-...
0
votes
0answers
10 views

A minor Web-app made with framework flask, having a minor problem

I've made a simple web-app here, the github repo of same is here. Actually, this performs a simple action, accepts three inputs from user via a registration form and as soon as the user hits up submit ...
0
votes
0answers
167 views

(psycopg2.errors.UndefinedTable) relation “users” does not exist

when i try to load up regster.html i get this error "sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation "users" does not exist LINE 1: INSERT INTO users(username,password) ...
0
votes
0answers
68 views

CS50W: “flask.cli.NoAppException” Can anyone explain this?

flask.cli.NoAppException: While importing "application", an ImportError was raised: Traceback (most recent call last): File "c:\users\hp\appdata\local\programs\python\python38\lib\site-packages\flask\...
0
votes
1answer
89 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
0answers
24 views

How to ensure proper database url in environment variable?

I am trying to run the code from lecture3 and I am having trouble ensuring the database url is properly set using the environment variable. Here's the code: db_url = 'postgresql+psycopg2://{username}:...
0
votes
1answer
71 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 ...
0
votes
1answer
24 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
0answers
71 views

CS50 Week 8 : Web Path - Flask Secret Key

I coded the code below following the lecture for CS50 Web path, for the database part https://www.youtube.com/watch?v=zdH1PnWxSpA&feature=emb_title minutes 6 It runs fine on the video, but it ...
0
votes
0answers
15 views

How to send data from a function of an imported python file to a html template using flask in Python

I have two python files, one for calling the html template which I will run and the other which has the funtion I want to call. I'm fairly new to flask python programming. When I run my main python ...
0
votes
1answer
15 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
130 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 ...
0
votes
0answers
77 views

failure at recreating register Flask --> NoAppException: Could not import “application”

Im trying to recreate the register app on my locally, however it seems the my application does not get pass importing the modules ? This is my application code: from cs50 import SQL from flask ...
0
votes
0answers
39 views

Textbook for understanding session in flask or in general web development?

Is there any good text book available which can explain the concept of session in web development ?
0
votes
1answer
236 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 * ...
0
votes
0answers
11 views

Trying to build an archive function for a student management app with Python and flask, need some help please

I have a list of active students which was added with a form. I'm now trying to add the ability to archive a child as soon as he/she's no longer active. I've been struggling with this for some time ...
0
votes
0answers
13 views

Is it possible to uniquely identify a client device ?? Maybe using mac address or something similar

I want to make a web-project that would allow the users to use my web-app only in one device at a time. I want to uniquely identify all the devices they registered for my app so that they can be ...
0
votes
0answers
400 views

How do I run flask app on windows?

I'm working on project 1 of CS50's Web Programming with Python and Javascript. While going through the steps given, I'm now stuck at running the app through command line. (step 6) The path to the ...
0
votes
1answer
29 views

Getting a phishing warning when running flask on cs50 IDE

Everything was working fine, but suddenly my browsers and anti-virus spit out warnings when I want to run flask on the cs50 IDE. I don't want to disable my antivirus every time I'm working on my ...
0
votes
1answer
63 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
1answer
75 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
2answers
350 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
86 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 ...
0
votes
1answer
213 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) * ...
1
vote
3answers
4k 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....
1
vote
1answer
545 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 ...