Here I got the right URLs
from django.http import HttpResponse
from django.shortcuts import render
import requests
def main(request):
return render(request,'main.html')
req = requests.get('https://d3.ru/api/posts').json()
arr = []
for data in req['posts']:
urls = data['main_image_url']
if urls != None:
arr.append(urls)
print('urls',arr)
How can i pass array arr into my template main.html into <img class>
{% extends "wrapper.html" %}
{% block title %}
<div class="container">
<img class = "col-12 ml-auto col-12 mr-auto" src=///arr???>
</div>
{% endblock %}