Skip to content
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms and Conditions

Programming Tutorial

Start Learning to Code

  • About Us
  • Contact Us
  • Privacy Policy
  • Terms and Conditions

Breaking News

Nextjs: running code after complete fetch

why does 400 status code result always entercatch block execution with axios?

Saving the state of the button onClick

TypeScript: Specify that value must be in Array using spread operator

Show separate number with comma in django tempalte

Why does my website keep showing old index.html, style.css, app.js…?

Using Python Flask to change the colour of an icon when it detects a words like scam, pending and verified

x clear icon appears only when the input has value – react

Login button redirects to two pages. For first time loginers, it redirects to agreement page, and for rest, it redirects straight to home?

WebComponent setter not triggered if defer is used

Category: Django

Django Questions and Answers

Django

Can I use a single search bar for searching different things?

admin January 9, 2022

I’m trying to use a single search bar for searching different models. Is it possible to handle it with one view? my views.py file: class SearchResultsView(ListView): model = Food template_name …

Django

Can’t pass a variable through my view to the html template

admin January 9, 2022

So I’m trying to: pass a variable owner_id in the view def new(request, owner_id) to render new.html that it will be used in the action of a form as a parameter/argument action=”{{ url ‘new’ …

Django

How to use reverse relation in my query?(django)

admin January 9, 2022

I’m trying to make a query to show all the branches which have the food. I’ve tried a lot but I can’t make it work. Could someone help me? Here are my models: class Branch(models.Model): name = …

Django

Django Customer with onetoone relationship with User – how to create the fields for that model when creating User?

admin January 9, 2022

Here is my problem – upon creation of User in django i want to also create Customer with Onetoone relationship. I was able to get this working but problem started when I wasn’t able to also create …

Django

how to add more attributes to what an api returns

admin January 9, 2022

I am trying to write an API using django rest framework in which, you give a username and a password and in return you get an AuthToken or in other words you login. now I want this API to also return …

Django

Django populating dropdown with values

admin January 9, 2022

Hello guys i want to populate a dropdown with the ids from the database, but when iterating over the list i get back also the brackets and the commas and some spaces. In views.py, i have the following:…

Django

Can not get comment id with AJAX in django

admin January 8, 2022

I’m fighting with this problem during several days and can not find the solution for my case. I’m trying to make system of likes without refreshing the page. In synchronous mode system of likes and …

Django

Django generic create view . Can we add conditions to save data from the form?

admin January 8, 2022

This is what my code looks like and I want to add some condition to the Borrower create view like if the stock method of book returns 0 then don’t list that book in field while creating a new borrower …

Django

I am trying to use search on my object in 3 fields name, category, and tags, so now similar item three time

admin January 3, 2022

views.py if search: wallpapers = Wallpaper.objects.filter(Q(name__icontains=search) | Q(category__category_name__icontains=search) | Q(tags__tag__icontains=search)) Html code

Django

How do I return the url back to details page once the comment is deleted – Django?

admin January 3, 2022

So at the moment once the comment is deleted, the URL takes back to the post list page. As probably you could tell that I am not very experienced with Django yet so if someone could explain that how …

Posts navigation

1 2 … 597 Next
Privacy Policy