Questions tagged [django]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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
0answers
86 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
158 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
44 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
82 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
14 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
163 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
155 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
53 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
96 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
113 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
193 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
251 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
0answers
62 views

Django form does not render in html template

so I've been trying to render a django form in an html template for about two hours now and I can't seem to get it to work. Any one with an idea or solution to this should kindly share, thanks :) Here'...
0
votes
1answer
39 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
132 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, ...
0
votes
0answers
16 views

I'm wondering how to import Django through my Powershell and how to active Django in my PythonPath

I'm trying to import and active Django in my pythonpath, but I still have this message show up in my manage.py tab on VSCode (I'm using Windows 10 and am finding a lot of Linux inputs): ""&...
0
votes
0answers
22 views

Django not accepting url arguments

my views.py contains def greet(request, name="World"): return HttpResponse(f"Hello, {name}!") and for this the urls.py for the app has url(r"^<str:name>/$", ...
0
votes
0answers
110 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
21 views

I keep getting invalid syntax at else. I am trying to redirect a page

here is the code. I keep getting invalid syntax at else. Can someone explain why and help please.
0
votes
0answers
29 views

I keep getting - TypeError: unhashable typ

can't get page to redirect please help. I keep getting the error TypeError: unhashable type: 'dict' at line: return HttpResponseRedirect (reverse("encyclopedia:index", { "entries":...
1
vote
0answers
160 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 ...
0
votes
0answers
425 views

Why I get a MultiValueDictKeyError when getting data from POST request?

I'm currently learning in Django, and in this fetch request, I always get the same error: topup.html let data = new FormData(); data.append('amount', document.getElementById(...