I installed photologue correctly in my project (blog) and I can add images in admin panel, but how to display them on my main page?
Asked
Active
Viewed 258 times
2 Answers
0
In the admin panel, you also need to:
- Create a gallery.
- Choose which photos are a part of which galleries.

Viktor Eikman
- 21
- 2
0
For one of my projects, I created a product model had a foreign key linked to a Gallery:
gallery = models.ForeignKey(Gallery, blank=True, related_name='gallery')
The issue in the template is that you cannot iterate over a Gallery or Photo from Photologue. I had to call product.gallery.photos.all()
in order to iterate over the collection of images in my gallery.
To get the url of the image to link to the src
of an <img>
tag, you can just run (if you're iterating):
for image in product.gallery.photos.all():
{{ image.url }}
Hope this helps!

jShiohaha
- 1
- 1