here is some code for you:
views.py
import os
def gallery(request):
path="C:\\somedirectory"
img_list =os.listdir(path)
return render_to_response('gallery.html', {'images': img_list})
gallery.html
{% for image in images %}
<img src='/static/{{image}}' />
{% endfor %}