6 votes

CS50 Web Programming Mail Pset - DOM reloading on every form submission

forms have a default of submission, if not specified destination , then to the link from which the get request(meaning from location, from where form came) . so just do event.preventdefault
user avatar
  • 63
3 votes

CS50W - Mail - Python Timestamp Error?

So, this is what I might class a 'half answer'. I'm still not entirely sure why I was getting an error with the timestamp string being incorrectly formatted as the governing documentation for strftime ...
user avatar
3 votes
Accepted

Does anyone know how to use Django on CS50 IDE?

Type python manage.py runserver 0.0.0.0:8080 and start the server. Then click the web server option in the IDE. After going to the site, remove the -beta from the url and press enter. It will show ...
user avatar
  • 957
2 votes
Accepted

Flask Sessions Not Working

Try setting the first conditional in your index function to: if session.get("notes") is None: This way you will only reset the session's collection of notes when it actually did not yet exist. At ...
user avatar
  • 136
2 votes

Can't create table from postgresql through sqlalchemy in python

DATABASE_URL should be an environment variable. You can set it via the cmd-line with export DATABASE_URL="postgres://jyszivev..." on Mac or set DATABASE_URL="postgres://jyszivev..." on Windows. by ...
user avatar
  • 21
2 votes
Accepted

cs50web switch from submit50 to me50?

You're correct that the submission process changed in late July. All of your old submissions can be seen here: http://legacy.cs50.me and new submissions here: http://submit.cs50.io Both groups of ...
user avatar
  • 18.3k
2 votes

CS50W - Project 0 - "I'm Feeling Lucky"

Had same problem and took me ages, but finaly found it! When completing a search with 'I'm feeling Lucky' have the Developers Tools open. In particular look at the Network and inspect the url and the ...
user avatar
  • 101
2 votes
Accepted

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

CS50W does not use cs50.me so you shouldn't expect to see it there. Is there something in the course information/materials that mentions using cs50.me? If so, can you let us know where so we can ...
user avatar
  • 18.3k
2 votes
Accepted

Cs50 Web Programming - How to autocomplete - Project 1

You don't have to 'autocomplete' as per, you can execute a 'LIKE' query on the database with the input entered by the user, like the following: book = ("%" + request.form.get("book") + "%").title() ...
user avatar
2 votes

CS50W - Mail - Python Timestamp Error?

I think it's because of how UNIX and Windows format their timestamps. From https://strftime.org/: The Python docs contain all the format codes that the C standard (1989 version) requires, and these ...
user avatar
1 vote

PSET9 / can't check until a frown turns upside down

Have a look at what your index renders if user buys 2 shares of something. I suspect it will show the price twice and not "total value for each holding". The usd function returns a string, ...
user avatar
1 vote
Accepted

CS50 (2021) - Finance. :( registration rejects duplicate username - expected status code 200, but got 400

The 'duplicate' check first registers a new user (which would return a 200) and then tries to register that same user (which would return a 400). The error you are seeing saying it was expecting a 200 ...
user avatar
  • 18.3k
1 vote
Accepted

Edit Function Help - CS50 Web Project1 Wiki

In the entry page, at the end you are specifying a url which should take you to the edit page. But instead it reloads the entry page as the path is 'entry' not 'edit'. If you do this small change then ...
user avatar
  • 957
1 vote

Help with Search Bar - Wiki Project1 CS50 Web Django

Nevermind, I have been able to figure it out. I had to use a GET request.
user avatar
1 vote

CS50W - Mail - Python Timestamp Error?

I had that problem too! well I don't know why but in Windows I got same error but in Mac OS it runs without any problem... You can fix it by replacing timestamp line with: "timestamp": self....
user avatar
1 vote

PSET8 Finance Buy. SQL query not executing

Did you test the query directly on the database? My gut says that the "/" in the buy/sell column name is causing problems. Try changing the column name in the table to something without any ...
user avatar
  • 63.1k
1 vote

CS50Web python. I can't get a new entry to save and show on the homepage of my wiki project. I am using Django with python

There might be more than one way of doing this, but I imported default_storage and ContentFile and it worked for me. from django.core.files.storage import default_storage from django.core.files.base ...
user avatar
  • 11
1 vote

CS50W - Wiki w/ Django - Search Bar

There seems to be a clash between the url paths defined as both are taking in similar patterns as arguments:- path("str:title", views.title, name="title"), path("search", ...
user avatar
1 vote

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

You should stop the django template engine from rendering the contents of your handlebars script block tag. You can do so by wrapping your handlebars' script with {% verbatim %}{% endverbatim %}. So ...
user avatar
  • 111
1 vote

adminer.cs50.net Not working

I am also having issues with logging into Adminer. There are also individuals with the same problem within this Reddit: https://www.reddit.com/r/cs50/comments/gjqnqy/...
user avatar
1 vote
Accepted

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

The only way I could think of is the history API. https://developer.mozilla.org/en-US/docs/Web/API/History_API#Adding_and_modifying_history_entries It's often used by single page applications (SPAs) ...
user avatar
  • 20.7k
1 vote

Instance of 'scoped_session' has no 'execute' member

When I run the code this error has occurred.
user avatar
1 vote
Accepted

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

You know it's a string and python knows it's a string, but postgres doesn't. When the column is text type (eg VARCHAR), the proper syntax is: SELECT col1, col2, col3 .... from table_name where col = '...
user avatar
1 vote

C$50 FINANCE- BUY ERROR

As per the sqlite doc, there are 3 forms of an INSERT stament. The first is INSERT INTO table VALUES(...); This INSERT INTO ? is incorrect. Neither table names nor column names can be ...
user avatar
1 vote
Accepted

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

In case anyone has this problem in the future: The big problem was fixed by ..."user_id": currentuser[0]}) where currentuser=session["user_id"] There were a handful of smaller problems after that, ...
user avatar
  • 63
1 vote
Accepted

CS50W Project1: Type error cannot pickle _thread._local object

My assumption is you are not using CS50's SQL class. Therefore, this db.execute("INSERT INTO users (username, hash) VALUES (:username, :hash)", {"username": username1, "hash": hashedpass}) does not ...
user avatar
1 vote
Accepted

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

passengers is a list of Passenger objects, therefore print(self.passengers) is printing a list of Passenger objects. This print(self.passengers.flight_id) would fail because self.passengers is a list ...
user avatar
1 vote

Cannot access CS50 Web settings for GitHub Pages

Your are correct. You are pushing to a repo which is not owned by you . Just create a repo in your github account and push to it . Then you cab publish it as a github page .
user avatar
1 vote
Accepted

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

Interesting output: invalid input syntax for integer: "080213825X" ISBN are not always numeric, at least not their check digit. The result of some calculation is taken mod 11, resulting in a number ...
user avatar
  • 20.7k

Only top scored, non community-wiki answers of a minimum length are eligible