python016 Design and implementation of collaborative filtering product recommendation system based on python

Collect and follow to avoid getting lost

Article directory

  • Preface
  • 1. Project introduction
  • 2. Development environment
  • 3. Function introduction
  • 4. Core code
  • 5. Effect drawing
  • 6. Article title

Foreword

This system is designed with two permissions: administrator and user. Users can view recommended products through this website, and then add them to the shopping cart for purchase. After the order is completed, they can evaluate, and administrators can directly upload their own products through this platform. Product information, after receiving the user’s order, can arrange delivery in time, which can save labor expenses, and can also bring high turnover and improve work efficiency.

Keywords: product information, order management, Django framework, MYSQL database

1. Project introduction

The current e-commerce platform has been completely integrated into our daily lives. For example, some major appliances, daily necessities, and even meals can be delivered through takeout, all with the help of e-commerce platforms. It is not limited by time and place, and you can compare multiple products. The prices are also very transparent. Moreover, the services of current e-commerce platforms are very good. Most of them support seven-day return and exchange without reason. Like some JD.com platforms, many e-commerce platforms During the warranty period, valuable products like this one are exchange-only and not repaired. The service completely surpasses the offline market. Users don’t have to worry at all. It can be seen that the e-commerce market has a very broad prospect. Therefore, the development of this system is very demanding and very promising.

2. Development environment

Development language: Python
Python framework: django
Software version: python3.7/python3.8
Database: mysql 5.7 or higher
Database tool: Navicat11
Development software: PyCharm/vs code
Front-end framework: vue.js

—————-

3. Function introduction

The front desk of this system is mainly developed for users. After users register and log in to their accounts, they can shop online, buy their own products, and conduct evaluations, collections and other operations. The administrator mainly manages the entire system and performs operations on the products. Management, managing user orders, etc. The functional structure diagram of this system is shown in 4-1 below:

Figure 4-1: System functional structure diagram

4. Core code

Part of the code:

def users_login(request):
    if request.method in ["POST", "GET"]:
        msg = {<!-- -->'code': normal_code, "msg": mes.normal_code}
        req_dict = request.session.get("req_dict")
        if req_dict.get('role')!=None:
            del req_dict['role']
        datas = users.getbyparams(users, users, req_dict)
        if not datas:
            msg['code'] = password_error_code
            msg['msg'] = mes.password_error_code
            return JsonResponse(msg)

        req_dict['id'] = datas[0].get('id')
        return Auth.authenticate(Auth, users, req_dict)


def users_register(request):
    if request.method in ["POST", "GET"]:
        msg = {<!-- -->'code': normal_code, "msg": mes.normal_code}
        req_dict = request.session.get("req_dict")

        error = users.createbyreq(users, users, req_dict)
        if error != None:
            msg['code'] = crud_error_code
            msg['msg'] = error
        return JsonResponse(msg)


def users_session(request):
    '''
    '''
    if request.method in ["POST", "GET"]:
        msg = {<!-- -->"code": normal_code,"msg":mes.normal_code, "data": {<!-- -->}}

        req_dict = {<!-- -->"id": request.session.get('params').get("id")}
        msg['data'] = users.getbyparams(users, users, req_dict)[0]

        return JsonResponse(msg)


def users_logout(request):
    if request.method in ["POST", "GET"]:
        msg = {<!-- -->
            "msg": "Exit successfully",
            "code": 0
        }

        return JsonResponse(msg)


def users_page(request):
    '''
    '''
    if request.method in ["POST", "GET"]:
        msg = {<!-- -->"code": normal_code, "msg": mes.normal_code,
               "data": {<!-- -->"currPage": 1, "totalPage": 1, "total": 1, "pageSize": 10, "list": []}}
        req_dict = request.session.get("req_dict")
        tablename = request.session.get("tablename")
        try:
            __hasMessage__ = users.__hasMessage__
        except:
            __hasMessage__ = None
        if __hasMessage__ and __hasMessage__ != "No":

            if tablename != "users":
                req_dict["userid"] = request.session.get("params").get("id")
        if tablename == "users":
            msg['data']['list'], msg['data']['currPage'], msg['data']['totalPage'], msg['data']['total'], \
            msg['data']['pageSize'] = users.page(users, users, req_dict)
        else:
            msg['data']['list'], msg['data']['currPage'], msg['data']['totalPage'], msg['data']['total'], \
            msg['data']['pageSize'] = [],1,0,0,10

        return JsonResponse(msg)


5. Renderings

Please add image description

Please add image description
Please add image description
Please add image description
Please add image description
Please add image description

6. Article title

Table of contents
Summary 1
Abstract 2
Chapter 1 Introduction 5
1.1 Topic selection background 5
1.2 Research status 5
1.3 Purpose and significance 6
1.4 System development goals 6
1.5 Paper structure arrangement 7
Chapter 2 Introduction to Development Technology 8
2.1 Introduction to Pycharm software 8
2.2 Introduction to B/S structure 8
2.3 Introduction to Mysql database 9
2.4 Introduction to Python language 9
2.5 Introduction to Django framework 10
2.6 Introduction to collaborative filtering algorithm 10
Chapter 3 Requirements Analysis 11
3.1 System requirements analysis 11
3.2 System feasibility analysis 11
3.2.1 Technical feasibility analysis 11
3.2.2 Economic feasibility 11
3.2.3 Operational feasibility 12
3.3 System process analysis 12
3.3.1 System data flow diagram 12
3.3.2 System activity diagram analysis 14
Chapter 4 System Design 16
4.1 System functional structure design 16
4.2 Database design 16
4.2.1 Database ER diagram design 16
4.2.1 Database table design 19
Chapter 5 System Implementation 24
5.1 Home page interface display 24
5.2 Implementation of product information display interface 24
5.3 Design and implementation of user registration interface 25
5.4 Design and implementation of login interface 25
5.5 Design and implementation of order submission 26
5.6 Design and implementation of online comment function 27
5.7 My order management design and implementation 27
5.8 Shopping information function 28
5.9 User information management 28
5.10 Product information management 29
5.11 Carousel image management function 29
5.12 Administrator order management 30
5.13 Implementation interface of product classification management function 30
Chapter 6 System Testing 32
6.1 Test purpose and significance 32
6.2 Test methods and steps 32
6.3 System functional test 32
6.4 Order management test 33
6.5 Test Summary 34
Summary 35
Acknowledgments 36
Reference 37