Questions tagged [django]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 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
17 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 ...
1
vote
1answer
14 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
0answers
23 views

MultiValueDictKeyError when using dropdown list with Pagination

I am working on CS50W project 2 -- Commerce -- I have decided to use Pagination in my app and it works in showing Active Listing page by page of 5 per page. problem occurs when i try the pagination ...
0
votes
1answer
14 views

How do we delete existing flight in sqlite via Django?

In the notes for the SQLITE section, week 3, https://cs50.harvard.edu/web/2020/notes/4/#:~:text=delete%20your%20existing%20flight%20from%20New%20York%20to%20London It states: Every time we make ...
0
votes
0answers
9 views

what is the difference between the 'wiki' vs. 'encylopedia' folder is project 1 django?

In the starter code there is a folder called encyclopedia and another folder called wiki. I know there's only one app according to the instructions, and that is encyclopedia. Is wiki suppose to be an ...
0
votes
0answers
16 views

cs50w: how to open a new page with a unique name for wiki/PAGE_NAME?

Project1: "Entry Page: Visiting /wiki/TITLE, where TITLE is the title of an encyclopedia entry, should render a page that displays the contents of that encyclopedia entry." I am having ...
0
votes
1answer
5 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
150 views

Mail Project 3 CS50W - Cannot Send Mail

I am stuck on CS50W's Project 3 Mail. I'm very new to JavaScript so I think I'm probably missing something obvious but I cannot get it to send an email. When I go to the admin section there's nothing ...
0
votes
1answer
371 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
65 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
159 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
0answers
27 views

Django - [Errno 2] No such file or directory error: when attempting to save an uploaded file to a dynamic url

Models.py: class Enterprise(models.Model): name = models.CharField(max_length = 100) def __str__(self): return f"{self.id}_{self.name}" class Client(models.Model): name =...
0
votes
1answer
290 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
324 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 ...
1
vote
2answers
82 views

How to get markdown info to HTML

Question from Project 1 in CS50W I'm stuck trying to get the markdown info from files to my HTML. I manage to get the markdown info into a HTML string, but when I input it to my HTML I get the same ...
0
votes
0answers
131 views

Running web applications (Django and/or Flask) on CS50 IDE

Hope you all are doing great. Had a quick question about the CS50 IDE and running web applications on it. One thing I noticed when running my web applications on CS50 IDE either by using "python ...
0
votes
1answer
195 views

CS50W Project 4 / Network - like counter not always saving to database

I was able to implement a like counter where it keeps track of all the likes. For some reason though, it randomly doesn't save the counter to the database when I submit the PUT request. I can't figure ...
0
votes
1answer
330 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
444 views

Django 127.0.0.1 refused to connect for the default Django Webpage

I am taking "CS50’s Web Programming with Python and JavaScript" and I have reached lecture 3 - Django. I am using the CS50 IDE for my program and I have done every step to start the basic ...
0
votes
1answer
62 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 ...
1
vote
1answer
149 views

How do correct I correct the pylint(no-member) error I get in the Web Flight lesson

Class Flight(models.Model): origin = models.ForeignKey(Airport, on_delete=models.CASCADE, related_name="departure") destination = models.ForeignKey(Airport, on_delete=models.CASCADE, ...
1
vote
0answers
203 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 ...