How can I access multiple variables at different positions? How does %s have to look like at inseration point and how at the end to correctly insert the variables.
Thanks!
Here is the code:
from django.http import HttpResponse
from django.contrib.auth.models import User
from favorites.models import *
def main_page_favorites(request):
title = Favorite.objects.get(id=1).title.upper()
email = User.objects.get(username='Me').email
image = Hyperlink.objects.get(id=3).url
output = '''
<html>
<head>
<title>
Connecting to the model
</title>
</head>
<body>
<h1>
Connecting to the model
</h1>
We will use this model to connect to the model.
<p>Here is the title of the first favorite: %s</p>
</body>
</html>''' % ( title, email, image
)
return HttpResponse(output)