联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Matlab编程Matlab编程

日期:2024-07-30 04:47

XJCO3011 Web Services and Web Data

Resit Coursework, July - August 2024

Submission Deadline: 9 August 2024 at 10:00

Using the DJANGO framework, design and implement a RESTful web API for an online retailer. The retailer maintains the following information about each of the products in stock:

· A Universal Product Code (UPC), e.g. ‘5000159471206’

· The product name, e.g. ‘Shaver’.

· The brand name, e.g. ‘McShaver’.

· The unit price, e.g. £44.90

· The quantity in stock, e.g. 20.

Customers can use a client application to order things from this retailer. This involves the following three steps:

1. Getting a list of all available products from the retailer website.

2. Adding products and the required quantity of each to a shopping basket. For simplicity, shopping basket data is maintained and managed on the client side (i.e. the server does not maintain shopping basket information).

3. Ordering all the products in the shopping basket in one go.

For simplicity, you don’t have to consider payment procedures, i.e. customers don’t have to pay for the products they order (a free shop, cool isn’t it). Also, no logging in or authentication is required for any of the services. Finally, customers don’t need to provide their details (such as name or address) to order the products in the shopping basket.

A. Using the DJANGO framework, implement a database and a RESTful API for the following two services:  (20 marks)

i. Obtaining a list of all available products.

ii. Ordering products.

Then, using the admin site (which will be automatically created by the DJNAGO framework), populate the database with information about a minimum of 5 hypothetical products of your choice).

B. Using Python 3 and the Requests library (https://pypi.org/project/requests/), write a simple client application that allows a user to: (20 marks)

i. Display a list of all available products.

ii. Add a product to the shopping basket (remember that the shopping basket is maintained locally on the client side).

iii. List the products currently in the shopping basket.

iv. Order the products in the shopping basket.

C. Write a short report (maximum 5 pages) containing the following:

i. A description of the database.

ii. Details of the API implementation for each of the two requests, including the HTTP verb, the URL, the request payload, the response codes, and the response payload.

iii. Clear instructions on how to run and use the client, and how to access the admin site (please share a username and password of the admin site so that I can use it to check the database).

The report itself does not have any marks assigned to it but the clarity of your report will affect the marks you are awarded for the relevant aspects of the mark scheme.

Bundle your Django project code, the code, and the report into a single directory. Compress the directory with Zip and upload to Minerva.

 


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp