richardbarran / django-photologue

A customizable plug-in photo gallery management application for the Django web framework.
BSD 3-Clause "New" or "Revised" License
674 stars 239 forks source link

Photo template tags not displaying pictures #191

Closed peterdoherty01 closed 6 years ago

peterdoherty01 commented 6 years ago

I've the same issue as previously reported by another user but can't seem to resolve my issue. I am using the templates from the example project and appear to have the correct setup in admin. Screenshots below. The issue is that the code below does not seem to register an object list.

This issue comes up when I want to use my own templates.

Any help would be greatly appreciated!

Code:

{% if object_list %}
        <div class="row col-lg-12">
            {% for photo in object_list %}
                <a href="{{ photo.get_absolute_url }}">
                     <img src="{{ photo.get_thumbnail_url }}" class="thumbnail" alt="{{ photo.title }}">
                </a>
            {% endfor %}
        </div>
    {% else %}
        <div class="row col-lg-12">
            <div class="row">{% trans "No photos were found" %}.</div>
        </div>
    {% endif %}

Admin Setup: image

Output: image

richardbarran commented 6 years ago

Do the photo thumbnails display correctly if you use the provided Photologue templates? There is only an issue when you use your own template?

peterdoherty01 commented 6 years ago

Hi Richard,

I can see the thumbnails and pictures when I fire up Photologue using photologue.urls. When I go to my custom urls e.g. showroom.urls, use templates from the showroom app, I get the above as in the screenshot. It just sees like object_list is turning up blank. I checked the media_url and media_root and I believe they are ok.

peterdoherty01 commented 6 years ago

I found a "workaround" for my issue. I start with the Photologue repo and add in the rest of my app around that. As opposed to starting from my app and then inserting Photologue. I must be missing something fundamental in my setup. My conclusion is that the issue is on me, not the codebase.

peterdoherty01 commented 6 years ago

I've reopened this as I cannot find a solution. I could show the pictures but not overide the template contents.