Skip to content
Advertisement

Tag: django-views

Django Query Multi Table

I’m trying to do a form query on a field and the goal is to get all the kids enrolled in all the teachers classes in this drop down menu. The query I have right now is getting all the classes a teacher is enrolled in . However how do I retrieve the kids within those classes. I attached a

Django ajax: in call does not make any changes

So I made this ajax view for my user model I extends my user model with an Integerfield of notification, but when I call the ajax it does not give +1 to my notification model, does anybody know what is going on? my urls.py and my ajax call my user profile model Answer So, change url: Then, change the view

How to fix TemplatesDoesNotExist error even after BASE_DIR has been Joined with templates in settings.py?

Image 1- Error I notice Exception Value: registration/login.html , I don’t even have that in the templates, instead, i have sign-in.html, I have no idea why it mentioned login.html. Please see my templates folder below as image 3-Templates. I’m trying to fix the above error. My project path looks like Image 2- project path Image 3- Templates The image 2

TypeError ‘Purchase’ object has no attribute ‘__getitem__’ [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question views.py def vendor(request,pk): current_shop = get_current_shop(request) instance =get_object_or_404(Vendor.objects.filter(pk=pk,shop=current_shop,is_deleted=False)) Answer purchases is a normal QuerySet that yields model instances when iterated over. All your other queries

Template file not found Django

I am trying to make a home page of a new website via Django. My app name is ‘blog’, home page is home.html I still receive the error template does not exist when I go to http://127.0.0.1:8000/blog/home/ I made sure I added ‘blog’ to my templates in settings.py and that I added the folder templates in the main directory as

Advertisement