May 2020
Intermediate to advanced
404 pages
10h 52m
English
This route will simply show the orders placed on the order management system. We use the following code:
from django.shortcuts import render, redirectfrom django.contrib import messagesimport requestsdef indexView(request): URL = "https://example.com/api/" r = requests.get(url=URL) data = r.json() return render(request, 'index.html', context={'orders': data['orders']})
We will create the viewOrder view in the following section.
Read now
Unlock full access