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

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

problem to submit CS50 project0 to github

I create a new branche web50/projects/2020/x/search to my CS50 repository github.com/me50/myname. I didn´t know what happen another project was pushed to this branche and the branche is set as default ...
0
votes
1answer
121 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
2answers
459 views

Mail CS50 Web - How to Send Email (API not working)

I'm very new to Javascript and working on mail, project 3 for CS50 web. I've been working on just sending the email initially, for about a week and I'm getting very discouraged. I can't seem to get ...
0
votes
1answer
155 views

Help please: I keep getting - TypeError: unhashable type: 'dict'

I keep getting - TypeError: unhashable type: 'dict' at line: return HttpResponseRedirect (reverse("encyclopedia:index", { "entries": util.save_entry(title, content) })) My code is ...
0
votes
1answer
82 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 ...
0
votes
0answers
11 views

cs50web project 4 network - "Edit" feature - how to execute two fetch() without the need to create a time delay?

Working on "Edit" feature for project4 network. I wrote a javascript function with two fetch. First one to update the post. Second one to retrieve the now updated post and show it on page (...
0
votes
1answer
59 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
1answer
134 views

CS50Web: Project1 Wiki - Error loading markdown2 module

I've tried to import the markdown2 module in my views.py file but I get an error ModuleNotFoundError: No module named 'markdown2'. I've tried restarting my machine, uninstalling and reinstalling the ...
0
votes
0answers
11 views

Search: Getting redirect notice for I'm Feeling Lucky

I'm getting a redirect notice when implementing I'm Feeling Lucky, similar to the below: Is there some way to bypass this notice? or is this acceptable for the purposes of this problem set?
0
votes
1answer
124 views

cs50 web programming with python & javascript. Entry not saving and I can't figure out why

I am a newbie coder and I just started the cs50 web programming course on edEX. I seemingly cannot get my code to save a .md (markdown file) in a directory. For now I am just trying to save the .md ...
0
votes
1answer
441 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
86 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
1answer
69 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
1answer
1k 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
2answers
244 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 ...
1
vote
1answer
447 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
1answer
115 views

CS50W - Django Forms vs HTML Forms

CS50W 2020 - Project 2 - Commerce How come in lecture 3 (https://cs50.harvard.edu/web/2020/notes/3/#django-forms) Django forms are used, but in lecture 4 (like here: https://cs50.harvard.edu/web/2020/...
0
votes
1answer
236 views

Django model default value not working

For some reason, the default value for a Django model field I have doesn't work. As in, if the value is left blank by the user when creating an object for that model, then when the value is used in a ...
0
votes
1answer
562 views

CS50 Web Python Project 1 Wiki: entry method causes search method to break

I'm working on Project 1 Wiki. I've independently got the entry and search functions to work, entry works by itself and search works by itself. If un-comment the code related to entry, search breaks. ...
0
votes
1answer
209 views

cs50w Project 1 Wiki Search: layout.html failing to submit POST to views.py

currently working on the search function for project 1. I've updated layout.html, urls.py, and views.py, but when I input anything into the search bar layout.html does not pass the POST information to ...
0
votes
1answer
875 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
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
0answers
23 views

CS50 web network project: like button reloads page and only displays json data instead of the actual webpage

I am working on the cs50 web project network. When the like button is clicked the text in the button should then change to say unlike and the like count should increase by one without reloading the ...
0
votes
0answers
19 views

CS50 Web Wiki Edit Form. Form is returning empty in the edit function

I am having issues with an empty form being provided in the edit function. Everything works well but when I try to edit an entry I get a Value Error saying the HTTPResponse is None and that the ...
0
votes
0answers
15 views

Q: CS50w project3. I keep getting this error: Uncaught (in promise) TypeError: Cannot read properties of null (reading 'appendChild') at new_thing

I am working on CS50 Web project 3 and I keep getting this error Uncaught (in promise) TypeError: Cannot read properties of null (reading 'appendChild') at new_thing here is my function function ...
0
votes
1answer
116 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
206 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
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 ...
0
votes
1answer
32 views

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

I am getting this message in the following checks :| sell page has all required elements/ :| sell handles invalid number of shares :| sell handles valid sale I guess the problem is in by sell or buy ...
0
votes
0answers
9 views

CS50W-NoReverseMatch Error?

Web Programming Project 1. I can't figure out what is causing this error. Tried searching for an answer everywhere. Error Message Reverse for 'edit' with no arguments not found. 1 pattern(s) tried: [...
0
votes
1answer
117 views

CASH NOT UPDATING - FINANCE SELL

so everything I have so far is working except the part where I need to update the cash right after I sell a stock. As you can see in the table below what's happening is that everytime I sell a stock ...
0
votes
1answer
130 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
388 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 ...
0
votes
1answer
519 views

CS50W - Wiki with Django - I want to edit a wiki entry, but I don't know how to send the default value to the template if I use Django forms

I've tried to do this: class editPage(forms.Form): title = forms.CharField() textContent = forms.CharField(widget=forms.Textarea(attrs={'class' : 'textContent'})) def edit(request,name): ...
0
votes
1answer
153 views

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

I can't get my code to save a new entry and return an error message if entry already existed. its just the views.py I can't figure out help please. code below
1
vote
1answer
16 views

cs50 web programming, wiki: extend function not working

I'm currently on project 1 wiki in cs50 web. The distribution code already gave me the blocks on layout.html and extend functions on index.html. For some reason, the code I put in the blocks in index....
0
votes
1answer
350 views

CS50W Django Project1 Wiki - Textarea issue

I got stuck at completing Wiki assignment because of strange behaviour of textarea in form, needed for creating and editing entries. Everytime user saves the entry, for each line of entered text there ...
0
votes
1answer
99 views

CS50Web - Not Sending Emails

I just started with the Mail project for CS50Web and came across a really strange problem. Currently, I'm working on the part where I need to send an email. My algorithm for this is simple: Add event ...
0
votes
1answer
7 views

default relative Imports in Django wiki failing

In views.py, when initially running the pregenerated line from . import util failed with relative import error. The standard from .dir import package also failed. Deleting __init.py__ also has no ...
0
votes
0answers
98 views

remove 'this field is required' text above django form in wiki

I have a style problem for the wiki project in cs50 web dev. It's one I could ignore and everything would still work, but I have been unable to solve it, and would like to learn what I am missing. I ...
0
votes
1answer
23 views

Specification imposes a 5-minute length limit on videos

I have made a youtube video on Commerce project which exceed 5 minutes. For this cause, my Project2: Commerce submission grading failed. How can I submit the project again. Please help me anybody.
0
votes
0answers
9 views

Server problem exit?

I run the python scraper bot but after a while the problem appears = --- server exit problem ---- how to handle it?
0
votes
1answer
83 views

CS50 web - problem 1, Wiki. Python syntax error

I'm just getting started with CS50 Web's problem 1 (wiki). I've got the code and I'm trying to run the Django server for the first time to see what the source code gives me. I have made no edits to ...
1
vote
2answers
353 views

Help with Search Bar - Wiki Project1 CS50 Web Django

For the Wiki project I'm having trouble implementing the search bar. I have spent about 2 days researching search bars in Django, but so far everything I've tried yields the same result: No matter ...
0
votes
0answers
78 views

"I'm Feeling Lucky" button only work if it's a definate keyword

I'm taking the CS50W course and in project0 the instructions is to make an "I'm Feeling Lucky" button that redirects you to the first page like the original does. after monitoring urls and ...
0
votes
0answers
14 views

Project: My "copy to clipboard" functionality works fine on my PC but not on iPhone or iPad :( Any ideas?

I'm doing my final project for CS50 and I have a html page which creates a list of items using a "for" loop, and a button below it which has a "copy to clipboard" function. It all ...
0
votes
1answer
329 views

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

I´ve been struggling to complete the Pset9 - Finance, version from 2021. After reading multiple threads I decided to post here the issue, looking for some guidance so I can move forward in the course. ...
0
votes
1answer
413 views

Does anyone know how to use Django on CS50 IDE?

I can’t seem to run Django on CS50 IDE. I downloaded Django without a problem. I can create a Django app without a problem using "python manage.py startapp hello". But the problem comes when ...
0
votes
0answers
71 views

Does anyone know how to use Django with minimal setup? Perhaps in a cloud environment or some IDE?

I can't seem to set up Django on my computer. As for running on my computer, I have just installed python and I think pip comes along with it? So I checked if I had pip installed using the command &...
0
votes
0answers
179 views

cs50w Wiki Edit Function: successful edit but NoReverseMatch for edit thrown

My edit function throws a NoReverseMatch (Reverse for 'editpage' with arguments '('',)' not found. 1 pattern(s) tried: ['editpage/(?P[^/]+)/$']) when I try and submit edits on the page. However, when ...