Questions tagged [django]

The tag has no usage guidance.

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

My CS50 Web Project 1 Edit page is not updating entries

My edit function is shown below: def edit(request,entry): if request.method =="GET": text = util.get_entry(entry) return render(request, "encyclopedia/edit.html", { ...
user avatar
  • 1
0 votes
1 answer
71 views

CS50W Project Wiki search function

I am trying to write the search function where the user submits a wiki search. If the query is in the given list of entries, the user should be redirected to related entry's page. If the query doesn't ...
user avatar
0 votes
0 answers
37 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 ...
user avatar
0 votes
0 answers
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 ...
user avatar
1 vote
1 answer
29 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....
user avatar
0 votes
0 answers
68 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 ...
user avatar
0 votes
1 answer
17 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 ...
user avatar
0 votes
0 answers
15 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 ...
user avatar
0 votes
0 answers
53 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 ...
user avatar
0 votes
1 answer
10 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 ...
user avatar
  • 1
0 votes
1 answer
511 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 ...
user avatar
0 votes
1 answer
400 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 ...
user avatar
1 vote
2 answers
487 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 ...
user avatar
1 vote
2 answers
122 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 ...
user avatar
0 votes
1 answer
265 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 ...
user avatar
0 votes
1 answer
445 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 ...
user avatar
0 votes
1 answer
843 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 ...
user avatar
0 votes
1 answer
82 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 ...
user avatar
1 vote
1 answer
183 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, ...
user avatar
1 vote
0 answers
214 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 ...
user avatar