May 2020
Intermediate to advanced
404 pages
10h 52m
English
If we pass an order ID to the same / route in the form of /orderId, then we should return the status of the order. Use the following code:
def viewOrder(request, orderId): URL = "https://example.com/api/" + str(orderId) r = requests.get(url=URL) data = r.json() return render(request, 'view.html', {'order': data['order']})
We have finished creating the different views that we will need for this project; however, we're yet to create the templates they will be rendering. Let's create the templates required in the next section.
Read now
Unlock full access