6

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


3

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 suggested it was fine. Nevertheless, I initially commented out that particular line within the Model in order to sense check that this was definitely what was ...


2

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 the moment you posted your code, you probably had set: session["notes"] = "value" earlier on, this resulted in the first conditional always evaluating to 'True'...


2

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 the way...you can create the table also using adminer.cs50.net


2

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 submissions are used for grading, so you should see the progress here: http://cs50.me/cs50w


2

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 tab on the left (Headers). Look for 'iflsig' parameter and it's value. In this case I've also used input type 'hidden'. I hope this leads you on the right path ...


2

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 remove that? I'm guessing you assumed it did since CS50x does? CS50W has no formal grading. If you are going for a verified certificate, you are required to ...


2

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() results = db.execute("""SELECT * FROM books WHERE "ISBN" LIKE (:book) OR "Title" LIKE (:book) OR "Author" LIKE (:book)""", {"book" : book}) Here, the first ...


2

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 disallowed host. So now add the url to the allowed hosts like this ["{{the url you got}}", '0.0.0.0']. Then wait for the server to reload or restart the ...


2

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 work on all platforms with a standard C implementation. Note that the 1999 version of the C standard added additional format codes. These include codes for non-...


1

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 and didn't get it. That tells me that it is the initial registration that is failing. If you delete all the rows from your user table and run check50 again, ...


1

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 special characters. Maybe txntype?


1

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", views.search, name="search") search here is being redirected to views.title with the title="search" Hope this is helpful.


1

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 your code should work. Hope this helps. If it does please check the tickmark


1

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


1

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.timestamp.strftime("%A, %d. %B %d/%m/%Y %I:%M%p"), I just changed the format of the timestamp and it worked! hope this answer helps you:)


1

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 in your case you should do the following: {% verbatim %} <script id="quote-template" type="text/x-handlebars-template"> <h3>Favorite {{name}} ...


1

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/adminer_login_session_expired_please_login_again/ And I also created a new post here: adminer.cs50.net giving "Session expired, please login again." error when attempting to login ...


1

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) to implement routing, so if you use browser controls to reload or move back and forth, you get more or less to the same state as before.


1

When I run the code this error has occurred.


1

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 = 'text' The text argument must be enclosed in single quotes ('). Something like "SELECT......where isbn ='"+sea+"'" There should be a space between where and ...


1

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 parametrized in sqlite. The ? in that statement needs to be changed to a table name.


1

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, but fixed relatively quickly, and irrelevant.


1

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 return the last inserted id. The CS50 SQL class does a lot of hard work for you. So new_user_id is an object (eg in sqlite a cursor object). So something like ...


1

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 and the list has no flight_id attribute. Program needs to iterate through passengers list to get the attributes (e.g. flight_id, name) of each Passenger object. ...


1

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 .


1

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 between 0 and 10 (both inclusive), the extra digit is the letter X. The import you wrote complains that you use an integer field to store a non-numeric ISBN. Use ...


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