Skip to content
Advertisement

How to display multiple django database models in a flex box row?

So just to give some information, I know how flexbox works and sorta know how django works and have displayed django database models on a page before already, using a loop. The issue I’ve encountered is I want to have multiple (three) of these models on a row kinda like if I used a flex box with three divs inside except because of the way the loop is running all three divs are the same. Any ideas on how to change the code for the divs to all be different models?

Here is my code :

Here is my item-store.html (Html Page to display the items) :

JavaScript

Here is my item-store.css (Css Page linked to the Html Page) :

JavaScript

Here is my models.py in case you need it :

JavaScript

And finally here is my views.py also in case you need it :

JavaScript

And here is a picture of my website to see what is displayed (The design is temporary) : Website Picture

Advertisement

Answer

How about this:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement