Skip to main content
7 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
Amber's user avatar
  • 73
4 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 ...
Vsjain's user avatar
  • 1,016
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 ...
thunderbirds1414's user avatar
3 votes

(Edited) CS50P - PSET 4 - LITTLE PROFESSOR

There is a requirement "hidden" in the How to Test section. Under the 3rd bullet it says (in part): Your program should output 10 distinct problems before printing... A review of your code ...
kcw78's user avatar
  • 837
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 ...
Remy's user avatar
  • 136
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() ...
Shrey Tripathi's user avatar
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 ...
Steff's 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 ...
curiouskiwi's user avatar
  • 18.7k
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 ...
Neri's 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 ...
curiouskiwi's user avatar
  • 18.7k
2 votes
Accepted

CS50W Project Wiki search function

I know this is late but if it helps somebody. The issue in your code is indentation. The moment the loop find the first matching substring it renders the page. Left indenting it by two levels should ...
Dineth Hettiarachchi's user avatar
2 votes

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, ...
DinoCoderSaurus's 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 ...
Fabio Mancin's user avatar
1 vote

CS50P project6 shirt.py

The size of the shirt I get when running the size method returns (600, 600), your sizes appear to be off
keg504's user avatar
  • 11
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 ...
curiouskiwi's user avatar
  • 18.7k
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 ...
Vsjain's user avatar
  • 1,016
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.
user14567126's user avatar
1 vote

CS50W Django Project1 Wiki - Textarea issue

I hit the same issue and found the solution. I thought I'd post it here in case others hit the same problem. The solution is here: https://stackoverflow.com/questions/62903909/django-contentfile-...
Doug F's user avatar
  • 11
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....
Amirhossein Safari's 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 ...
Cliff B's user avatar
  • 69k
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 ...
Brian's 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", ...
Nikhil Bararia's 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) ...
Blauelf's user avatar
  • 21k
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 ...
pebox11's user avatar
  • 111
1 vote

Instance of 'scoped_session' has no 'execute' member

When I run the code this error has occurred.
Shahbaaz's 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 = '...
DinoCoderSaurus's 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 ...
DinoCoderSaurus's 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, ...
azb1297's 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 ...
DinoCoderSaurus's 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 ...
DinoCoderSaurus's user avatar

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