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

Filter by
Sorted by
Tagged with
0
votes
0answers
5 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 ...
1
vote
1answer
10 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
16 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
65 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 ...
0
votes
0answers
58 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
1answer
4 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
1answer
58 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
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
2answers
277 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
228 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
274 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
53 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
121 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 ...
0
votes
1answer
156 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
231 views

Edit Function Help - CS50 Web Project1 Wiki

I've been having trouble with the edit function for the wiki project1. So far I've tried many different approaches but nothing has worked. I have the "edit" button on every entry page of the ...
1
vote
2answers
259 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
12 views

How does the server know if the client has received the data completely?

As i've understood, the client first enters a domain name and the DNS returns it an IP address where the client sends his request and gets a response from the server. Now while sending it back, the ...
0
votes
0answers
19 views

Issue using Mingus package in CS50 project: /bin/sh: 1: lilypond: not found

I am trying to use the Lilypond module from the Mingus package (for my final project) in CS50 IDE, but while running the following python code (as provided in the docs), it returns an error: >>&...
0
votes
0answers
29 views

Confusion in cs50 Javascript course 2020

In the Javascript lecture pf CS50's Web Programming with Python and Javascript , there is an example where Brian tells that how to use dataset and fetch the value of it in the case of multiple buttion ...
0
votes
0answers
69 views

CS50W - Project 4: Network - Followers Model

I'm having trouble implementing the followers part of this project. The spec seems to say that you should have a seperate model called Followers, and not just add a followers field to the User model. (...
0
votes
1answer
264 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
113 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
23 views

Flask-WTF: input field rendered based on the user's selection

I'm trying to make a form where the user logs an action they've done. Because there were too many actions, they are now split into categories and then, based on which category the user chooses, the ...
0
votes
1answer
102 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
52 views

Struggling to debug my code as I can't get print statements to work

I've been working on Project 1 from CS50W for a few days now and finally got my search bar to appear on my page! The issue I have now is I don't think the input is being pulled in from my form. I've ...
0
votes
0answers
205 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
475 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. ...
1
vote
3answers
218 views

CS50W - Mail - Python Timestamp Error?

Per the problem set, I've not changed any of the Python that's included within the problem set for 'Mail'. I've only been tweaking with the JS and the HTML thus far. That's not to say my JS is ...
0
votes
1answer
100 views

PSET8 Finance Buy. SQL query not executing

My buy function is crashing at the SQL query where I'm trying to insert data from the transaction into a transactions table. The types of each column are transaction_id(integer, primary key), user_id(...
0
votes
1answer
94 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
0answers
105 views

Final Project: Error on uploading files to CS50 IDE via form

tl;dr: CS50 IDE won't let me upload certain kinds of files (via a form on a webpage) without any explanation. I'm writing the function upload_file() that allows the user to upload a file. (It's a CSV ...
0
votes
1answer
89 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
0answers
119 views

how do I perform a search

This is project one for wiki and I am stuck this is my last thing to do. below are screenshots of the views.py, util.py and template. We are suppose to use the functions from util.py(This is the last ...
0
votes
0answers
337 views

CS50 Web 2020, Project 1 - Wiki, CSS not working

I'm currently using Django as explained in cs50w 2020 lecture 3. Under the static folder inside encyclopedia directory is the styles.css. This was in the distro code and there is already some styles ...
0
votes
1answer
130 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
0
votes
2answers
541 views

CS50W - Wiki w/ Django - Search Bar

I cannot for the life of me get the HTML form to transfer the user's search into my search function within views.py. I've tried this a number of different ways and I either just get no movement (as I ...
0
votes
1answer
127 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 ...
1
vote
1answer
720 views

CS50W - Project 0 - “I'm Feeling Lucky”

For the "I'm Feeling Lucky" part, I'm getting a redirect notice (like this: https://images.app.goo.gl/Mgk6knNBYHfe5YKB7). How do I bypass this? Thank you!
0
votes
1answer
466 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
0answers
3k views

raise JSONDecodeError(“Expecting value”, s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@app.route('/api/<string:isbn>', methods = ['GET']) def isbn(isbn): #import api from Goodreads (stats) book_data = db.execute("SELECT * FROM books WHERE isbn=:isbn",{'isbn':isbn})....
0
votes
0answers
84 views

How do I create an advanced query page using HTML and CSS? Should I use any other langauges to make it a faster process?

How do I create an advanced query in HTML and CSS? I have to create a front end similar to Google and have already outfitted the first two pages, it's the 3rd page, the advanced query page that I need ...
1
vote
0answers
195 views

decoding to str: need a bytes-like object, HttpResponse found

While converting markdown to html i am getting this error def title(request, title): global mdValue mdValue = util.get_entry(title) htmlValue = m.convert(mdValue) # error occurs on this ...
1
vote
1answer
150 views

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

On the mail pset the inbox page loads as default whenever the DOM is loaded. Whenever I submit my form to send an email the DOM is reloaded and inbox pops up. I'm trying to get the sent mailbox to pop ...
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
80 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....
1
vote
1answer
795 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
43 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
1answer
66 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....