Untitled
1 day ago in Plain Text
from django.shortcuts import render
from icecream.models import icecream_db
from anfisa.models import friends_db


def index(request):
icecreams = ''
friends = ''

for friend in friends_db:
friends += f'{friend}<br>'

for i in range(len(icecream_db)):
icecreams += (f'{icecream_db[i]["name"]}'
f'<a href="icecream/{i}/">узнать состав</a><br>')

context = {
'icecreams': icecreams,
'friends': friends,

}
return render(request, 'homepage/index.html', context)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23