Questions tagged [cs50-web-programming-with-python]

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

Flask-socketio not able to send instant messages

I am trying to make a basic chat application with rooms using flask-socketio, but whenever I run the code on my browser, a weird error comes on the console and I am not able to send any messages ...
0
votes
0answers
18 views

href not working properly

i have a layout html file in the following path: C:\Users\user1.vscode\files\web50p1\templates\layout.html in which i have the following code: <a href="/logout">Log Out</a></li&...
1
vote
0answers
33 views

cs50w Project 1: Web page running very slow

I just finished my book review page for project 1 and everything is working fine, but the site takes forever to load certain parts. When trying to log in or create a new account, or when trying to ...
0
votes
1answer
75 views

Can't import books.csv using import.py

I'm on a project1, here is the link to it: https://docs.cs50.net/ocw/web/projects/1/project1.html I've successfully made a Table books using my Python script, however when I try to import the "books....
0
votes
0answers
95 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
679 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
20 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
40 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 ...
1
vote
0answers
2k views

sqlalchemy.exc.ArgumentError: Could not parse rfc1738 URL from string

Traceback (most recent call last): File "list.py", line 9, in engine = create_engine(os.getenv("DATABASE_URL")) File "C:\python 3.8\flask_env\env1\venv\lib\site-packages\sqlalchemy\...
0
votes
0answers
27 views

CS50 Web Project 1: Is it necessary to use raw SQL queries?

This is not strictly a coding question, can we use the SQLAlchemy ORM for the Books project? I know it is forbidden to use as per the requirements, but I am unable to run my program using raw ...
0
votes
1answer
64 views

Problem in importing from csv file

I am currently trying to import the contents of the books.csv file into my PostgreSQL database on Adminer. Here's my code: import csv import os from sqlalchemy import create_engine from sqlalchemy....
0
votes
0answers
11 views

Can I use databases to take in signup information from the user?

Can I use database in my Project 1 website for the user signup and login, to store the user information? Or is it necessary to use sessions, as mentioned in the 'hints' section of the Project 1 ...
0
votes
2answers
187 views

adminer.cs50.net giving “Session expired, please login again.” error when attempting to login

This seems to have happened 11 Sept 2019 but it is occurring again. I tried logging into Adminer today and am receiving this error: "Session expired, please login again." I thought my Heroku ...
0
votes
0answers
1k views

NameError: name 'db' is not defined

I've made a simple code using python, where with the help of Flask_sqlalchemy I am trying to create 2 tables in a database which is being hosted by Heroku. The file db.py contains my table details ...
0
votes
0answers
53 views

CS50W Project 2: socket.io is not working for me

I am trying to create the channels real time so they can be broadcasted and i save them in a list on the backend. I will later make sure that all the channels in the list are also put in the list but ...
0
votes
0answers
291 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
21 views

Project0 bot marks

I am doing a course called Web Development with Python and JavaScript, i did my project0 and submitted it. After a few days i got an email from c50 bot as shown in the image, i cant understand it ...
0
votes
0answers
1k views

ValueError: not enough values to unpack (expected 2, got 0)

I'm having this value error when I run my menu function. Please help me solve this error. Thank you. python code : def index(request): if not request.user.is_authenticated: return render(request,...
0
votes
1answer
482 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
37 views

Flash message disappears after redirect

So, during my work on CS50 WEB programming course I came up with this issue. In my Books application (Project 1), when user tries to leave a second review to the same book, the code doesn't let him ...
0
votes
0answers
38 views

can't fetch value from frontend… “document.querySelector('#text').value;” not working

<html> <head> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js"></script> <script src="http://ajax.googleapis....
1
vote
1answer
170 views

Instance of 'scoped_session' has no 'execute' member

Getting the following problem using flask and SQLAlchemy: "Instance of 'scoped_session' has no 'execute' member pylint(no-member)". I use Windows 10, Flask. I suppose that the problem is somehow ...
0
votes
1answer
651 views

sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedFunction) operator does not exist: character varying = integer

In this code when I search in the book 0 index it shows the error ..... but the statements in elif statement work perfectly. When I manually enter the value instead of putting sea variable in my query ...
0
votes
1answer
106 views

CS50W Project2: communication between SocketIO and JavaScript

I'm trying to get new channel names input by the user to 1) show up on the screen in an unordered list and 2) also show up on other users' screens. I tried to closely follow the template that was used ...
0
votes
1answer
24 views

How to simulate different users using only one machine

I am using LocalStorage to save the display name and it does remember the display name after the browser is closed. However to simulate different users on the same machine chatting to each other, I ...
0
votes
1answer
41 views

C$50 FINANCE- BUY ERROR

I have a problem with my code on buy. I was wondering if anyone can help me identify the error. Whenever I go to the buy and enter the symbol and shares and click buy, it shows a 500 Internal Server ...
0
votes
1answer
89 views

CS50w Project1: Trouble posting reviews (Row Proxy error - how to ensure a tuple)

The last bit I am struggling with on Project1 is posting a rating and review. I continually get sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) can't adapt type 'RowProxy' [SQL: INSERT ...
0
votes
2answers
41 views

CS50W Project1: ISBN too short, csv file does not provide correct ISBNs?

I was having an requests.exceptions.HTTPError: 404 Client Error: Not Found for url: error. I noticed after reading some of the documentation on Goodreads that we can use either 10-digit ISBNs or 13-...
0
votes
1answer
86 views

CS50W Project1: how to access specific part of json object

I am working on the part of the project where people can click on a book from the search results page, which will then take them to the specific book's page. I am getting this error: json.decoder....
0
votes
2answers
467 views

CS50W Project1: Type error cannot pickle _thread._local object

Currently working on CS50W's Project1, working with the GoodReads API. I thought the Register/Login/Logout requirements would be easy and quick for me to complete since I did it already with the CS50 ...
0
votes
1answer
127 views

CS50 Web Programming: Lecture 3 (SQL)- import.py won't work for me

I'm trying to run the same code for import.py from the lecture, but am running into trouble. import.py: import csv import os from sqlalchemy import create_engine from sqlalchemy.orm import ...
0
votes
1answer
25 views

CS50_Web ORMs,APIs_ lecture 4, classes4.py - Understanding Classes, Objects, Functions and Lists

I've "simplified" the ORMs,APIs- lecture 4_web_classes4.py code to try and understand more about Python classes, objects and list. can anyone help me out? Question 1: Why doesn't print(self....
0
votes
1answer
888 views

Disable caching of css and js file in flask on Safari or Chrome?

Is there any way so that on refresh it loads css , js file automatically in flask . I am using MacOS and using two browser Safari and Chrome . Currently on safari I have to clear cache and refresh the ...
0
votes
1answer
134 views

Cannot access CS50 Web settings for GitHub Pages

How can I enable my CS50 Web repo to be hosted on GitHub Pages? There is no Settings tab on my CS50 Web repository on GitHib. As such I cannot enable the repo for GitHub Pages as shown at the end of ...
0
votes
0answers
45 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
2answers
444 views

CS50's Web Programming - Unable to import books.csv file into database

I'm on a project1, here is the link to it: https://docs.cs50.net/ocw/web/projects/1/project1.html I've successfully made a Table books using my Python script, however when I try to import the "books....
0
votes
1answer
76 views

cs50 project3: django multivaluedictkeyerror

I am working on CS50 Web Programming with Python and JavaScript Project 3. I keep getting the multidictkeyerror everytime i tried to submit the form. It seems like the value just does not get ...
1
vote
2answers
616 views

Can't create table from postgresql through sqlalchemy in python

I am working on project 1 of python and javascript web programming and have no clue why it just can't create table. The coding execute without returning any error. Below is the code and I really ...
1
vote
1answer
269 views

cs50web switch from submit50 to me50?

I started with cs50 web earlier this year, completed the first 3 assignments and then submitted by pushing them to the relevant branch of the submit50/USERNAME.git repository, and got a grading email ...
1
vote
1answer
437 views

API Goodreads issue with the book page

I have been facing an issue with the API, it does not display in the book page in project1 I keep getting the error "Not Found" could someone help me? Check the screenshots of the python code below, ...
0
votes
3answers
557 views

adminer.cs50.net Not working

Guys there has been a problem in the website : "https://adminer.cs50.net" I tried to login multiple times and keeps giving me the error: "Session expired, please login again." could someone please ...
0
votes
1answer
20 views

How does the cs50 video player update the url in real time?

I´m curious about how the timestamp in the URL gets updated as the video plays. Is the server sending GET requests every second?
0
votes
1answer
127 views

Cs50 Web Programming - How to autocomplete - Project 1

I am doing project 1 and I have a problem. While doing the search page, I have show possible autocompleted texts to help the user with the search, but I don't know how to do that. I know it was shown ...
0
votes
1answer
102 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
2k views

socket.io won't connect BAD REQUEST “POST /socket.io/?EIO=3&transport=polling&t=1554987462099-61&sid=9e90c33eadea427db79c14a251130c15 HTTP/1.1” 400 -

I am trying to finish cs50w project 2 but I can't get socket.io to connect (at least i think that is the problem) I went into the source file and tried to recreate their example from vote1. This is ...
2
votes
1answer
214 views

How to integrate handlebars(written in raw javascript) into django templates

Please, I'm still rather new to handlebars templating, my handlebars template works perfectly with just html files, but when I try to render the page containing the handlebars template, I get all sort ...
1
vote
1answer
623 views

CS50-Web programming not showing up in course section CS50.Me

I enrolled in CS50 Web Programming with Python and Javascript through EDX. After linking my Github and EDX with cs50.me I expected that the course would show in my course list, but is still has not. I ...
0
votes
1answer
205 views

PSET 1 Introduction to Python and Javascript linking database issue

I am having issues linking my flask program to Postgre SQL import os from flask import Flask, session from flask_session import Session from sqlalchemy import create_engine from sqlalchemy.orm ...
0
votes
1answer
379 views

CS50 Web programming - Git command to open file in Atom text editor and edit file. (Branching in Git)

I have atom editor installed and git bash on my windows PC. In the screenshot below - Brian opens the file in atom editor using atom . command on his MAC machine. However same cannot be done on the ...
0
votes
1answer
376 views

CS50 Web programming with python: project2

When i'm running 'flask run' from the terminal window, I'm getting '* Serving Flask-SocketIO app "application"', however I don't get further provided with an URL!? Anyone any thought on that what the ...

1
2