计算机毕业设计 基于Python音乐平台的设计与实现 Python毕业设计 Python毕业设计选题 Vue 前后端分离【附源码+安装调试】

博主介绍:✌从事软件开发10年之余,专注于Java技术领域、Python人工智能及数据挖掘、小程序项目开发和Android项目开发等。CSDN、掘金、华为云、InfoQ、阿里云等平台优质作者✌

🍅文末获取源码联系🍅

👇🏻 精彩专栏推荐订阅👇🏻 不然下次找不到哟


计算机毕业设计《1000套》

Python毕设精品项目

微信小程序毕设精品项目

大数据及机器学习毕设精品项目

PS:Python、大数据、机器学习等,可以用源码,或者定制开发!

目录

1、项目介绍及开发技术

[1.1 项目介绍](#1.1 项目介绍)

[1.2 开发技术](#1.2 开发技术)

2、系统功能设计结构图

3、功能截图

[3.1 前台功能](#3.1 前台功能)

[3.2 后台功能](#3.2 后台功能)

4、关键代码

[4.1 setting.py](#4.1 setting.py)

[4.2 urls.py](#4.2 urls.py)

[4.3 config_v.py](#4.3 config_v.py)

[4.4 user_v.py](#4.4 user_v.py)

5、论文目录结构

6、源码获取


1、项目介绍及开发技术

1.1 项目介绍

在数字化时代,音乐已成为人们日常生活中不可或缺的一部分。随着互联网技术的发展,在线音乐平台因其便捷性和丰富的音乐资源而受到广泛欢迎。为了满足用户对音乐的多元化需求,我们开发了一个基于Python的音乐平台,旨在为用户提供一个集音乐欣赏、信息浏览、互动交流于一体的音乐体验。

背景: 当前,用户对音乐平台的需求不再仅限于听歌,他们还希望了解歌手信息、参与音乐讨论、获取音乐推荐等。然而,现有的音乐平台往往功能单一,难以满足用户的多样化需求。此外,随着版权意识的增强,音乐平台需要更加注重版权管理和内容审核。

目的意义:

  1. 丰富用户体验: 平台提供热门音乐推荐、音乐海报展示、歌手信息查询等功能,丰富用户的在线音乐体验。
  2. 促进社区互动: 音乐论坛为用户和歌手提供了一个交流的平台,增强了用户之间的互动。
  3. 提升信息获取效率: 用户可以通过系统首页快速获取最新通知和音乐资讯,提高了信息获取的效率。
  4. 优化内容管理: 后台管理系统为管理员提供了音乐分类、歌手信息、通知公告等管理功能,优化了内容的更新和管理。
  5. 支持决策制定: 系统日志和数据分析功能为平台运营者提供了用户行为分析,支持更精准的市场决策。

综上所述,基于Python的音乐平台旨在为用户提供一个全面、便捷的在线音乐服务,同时为平台管理者提供一个高效、智能的管理工具。通过技术手段优化音乐服务流程,该平台有望成为推动音乐行业发展的重要力量。

1.2 开发技术

技术仅供参考,普通Python Web项目,一般采用Django/Flask(少用)+Vue+MySQL,爬虫框架为Scrapy。Python大数据项目,一般采用了Hadoop、Spark、Scrapy、DataGrip等。

序号 技术名称 类型 版本/备注 用途描述
1 Python 编程语言 Python 3.7.7 广泛用于Web开发、数据科学、AI等领域
2 Django Web框架 Django2.0 高级Web框架,用于快速开发Web应用
3 Flask Web框架 Flask2.0.0 轻量级Web框架,适合小型项目
4 Scrapy 爬虫框架 Scrapy2.9.0 用于编写爬虫程序,快速抓取网页数据
5 Hadoop 大数据处理 分布式存储和计算框架,适合大数据存储和处理
6 Spark 大数据处理 pyspark3.3.2 快速、通用的集群计算系统
7 MySQL 数据库 MySQL5.7+ 关系型数据库,用于存储和管理数据
8 Navicat 数据库管理工具 Navicat11+ 数据库管理和开发工具,支持多种数据库
9 DataGrip 数据库管理工具 强大的数据库管理工具,支持多种数据库
10 PyCharm 开发环境 Pycharm2021 Python IDE,提供代码编辑、调试等功能
11 VSCode 开发环境 VSCode1.15.1 轻量级但功能强大的代码编辑器
12 Node.js 服务器端JS环境 Node 14.15.0 用于构建高性能的服务器端和网络应用

2、系统功能设计结构图

功能模块结构图

├── 前台

│ ├── 登录/注册

│ ├── 系统首页

│ ├── 热门音乐

│ ├── 音乐海报

│ ├── 歌手信息

│ ├── 音乐论坛

│ ├── 通知公告

│ └── 个人中心

└── 后台

├── 登录

├── 系统首页

├── 个人中心

├── 用户管理

├── 热门音乐管理

├── 音乐分类管理

├── 音乐海报管理

├── 歌手信息管理

├── 音乐论坛管理

├── 系统管理

│ ├── 关于我们

│ ├── 系统简介

│ ├── 轮播图管理

│ ├── 系统日志

│ ├── 通知公告管理

│ └── 通知公告类型管理

这个结构图展示了前后端的功能模块。前台主要面向用户,提供登录、注册、浏览系统首页、热门音乐、音乐海报、歌手信息、音乐论坛、通知公告以及个人中心等功能。

后台则为管理员提供了系统管理的界面,包括用户管理、热门音乐管理、音乐分类管理、音乐海报管理、歌手信息管理、音乐论坛管理以及系统管理(关于我们、系统简介、轮播图管理、系统日志、通知公告管理、通知公告类型管理)。管理员可以通过这些模块对系统内的数据进行维护和管理,确保系统的稳定运行和信息的准确性。通过这样的系统设计,基于Python的音乐平台能够为用户提供便捷的音乐服务,同时为系统管理者提供高效的管理工具。

架构图(不同框架)参考展示:

3、功能截图

3.1 前台功能

3.2 后台功能

4、关键代码

4.1 setting.py

python 复制代码
"""
Django settings for dj2 project.

Generated by 'django-admin startproject' using Django 2.0.

For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""

import os
from concurrent.futures.thread import ThreadPoolExecutor
executor = ThreadPoolExecutor(20)
from util.configread import config_read

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'w5yn#0gn2tt7pvu%hvwt0!lt=!$6+eqp4%m8)u3u#gknm@jm)k'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ["*"]

# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    "main",
    'corsheaders',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    # 'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'threadlocals.middleware.ThreadLocalMiddleware',
    "xmiddleware.xparam.Xparam",
    "xmiddleware.xauth.Xauth",
    'corsheaders.middleware.CorsMiddleware',
    'django.middleware.common.CommonMiddleware',
]
CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_HEADERS = ('*')

SESSION_ENGINE = "django.contrib.sessions.backends.cache"
SESSION_COOKIE_NAME  = "sessionid"
SESSION_COOKIE_PATH  = "/"
SESSION_COOKIE_DOMAIN = None
SESSION_COOKIE_SECURE = False
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_AGE = 1209600
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
SESSION_SAVE_EVERY_REQUEST = False

ROOT_URLCONF = 'dj2.urls'
TEMPLATES_DIR = os.path.join(BASE_DIR, "templates")
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [TEMPLATES_DIR],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'dj2.wsgi.application'

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = False
EMAIL_USE_SSL = True
EMAIL_HOST = 'smtp.qq.com'
EMAIL_PORT = 465
EMAIL_HOST_USER = 'yclw9@qq.com'
EMAIL_HOST_PASSWORD = 'mhbrkuayvkkgbijd'

# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases

# DATABASES = {
#     'default': {
#         'ENGINE': 'django.db.backends.sqlite3',
#         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
#     }
# }

dbtype, host, port, user, passwd, dbName, charset,hasHadoop = config_read("config.ini")
dbName=dbName.replace(" ","").strip()
print(dbtype, host, port, user, passwd, dbName, charset)

if dbtype == 'mysql':
    DATABASES = {
        'default': {
            # 'ENGINE': 'django.db.backends.sqlite3',
            # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
            'ENGINE': 'django.db.backends.mysql',
            'OPTIONS': {
                'sql_mode': 'traditional',
                'init_command': "SET sql_mode='traditional'",  # STRICT_TRANS_TABLES
            },
            'NAME': dbName,
            'USER': user,
            'PASSWORD': passwd,
            'HOST': host,
            'PORT': port,
            'charset': charset,
            'TEST': {
                'CHARSET': charset,
                'COLLATION': 'utf8_general_ci',
            },
            'CONN_MAX_AGE':60
        },
    }
else:
    print("请使用mysql5.5数据库")
    os._exit(1)

if 'spark' in hasHadoop or 'hive' in hasHadoop:
    jar_fielpath=os.path.join(BASE_DIR,"bin","mysql-connector-java-8.0.32.jar")
    print(jar_fielpath)
    if os.path.exists(jar_fielpath)==False:
        print('请检查mysql-connector-java-8.0.32.jar文件是否存在')
        os._exit(1)
    try:
        spark = SparkSession.builder.config("spark.jars",jar_fielpath).master("local").appName("django").getOrCreate()
    except Exception as e:
        print('请检查spark配置',e)
        os._exit(1)
    jdbc_url=f'jdbc:mysql://{host}:{port}/{dbName}?user={user}&password={passwd}&driver=com.mysql.jdbc.Driver'


# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]

# Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/

LANGUAGE_CODE = 'zh-Hans'

# TIME_ZONE = 'UTC'
TIME_ZONE = 'Asia/Shanghai'

USE_I18N = True

USE_L10N = True

# USE_TZ = True
USE_TZ = False

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/



STATIC_URL = '/assets/'
STATICFILES_DIRS =[
os.path.join(BASE_DIR, "templates/front/assets"),
]

# media
MEDIA_URL = "/media/"  # 自定义
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')  # 自定义
if os.path.isdir(MEDIA_ROOT) == False:
    os.mkdir(MEDIA_ROOT)

ALIPAY_APP_ID = ''
APP_PRIVATE_KEY_STRING = open('{}/util/alipay_key/app_private_2048.txt'.format(BASE_DIR)).read()
ALIPAY_PUBLIC_KEY_STRING = open('{}/util/alipay_key/alipay_public_2048.txt'.format(BASE_DIR)).read()
ALIPAY_SIGN_TYPE = 'RSA2'

4.2 urls.py

python 复制代码
"""dj2 URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
import os
from django.contrib import admin
from django.urls import path,include,re_path
from django.conf.urls import url
from django.views.static import serve
from django.views.generic import TemplateView


from . import views
from dj2.settings import dbName as schemaName

urlpatterns = [
    path('xadmin/', admin.site.urls),
    path(r'index/',views.index),
    path('{}/'.format(schemaName),include('main.urls')),#导入schemaName
    re_path(r'admin/lib/(?P<p1>.*)/(?P<p2>.*)$', views.admin_lib2),
    re_path(r'admin/lib/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)$', views.admin_lib3),
    re_path(r'admin/lib/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)/(?P<p4>.*)$', views.admin_lib4),
    re_path(r'admin/page/(?P<p1>.*)$', views.admin_page),
    re_path(r'admin/page/(?P<p1>.*)/(?P<p2>.*)$', views.admin_page2),
    re_path(r'admin/pages/(?P<p1>.*)$', views.admin_pages),
    re_path(r'admin/pages/(?P<p1>.*)/(?P<p2>.*)$', views.admin_pages2),
    
    re_path(r'front/(?P<p1>.*)$', views.schema_front1),
    re_path(r'front/(?P<p1>.*)/(?P<p2>.*)$', views.schema_front2),
    re_path(r'front/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)$', views.schema_front3),
    re_path(r'front/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)/(?P<p4>.*)$', views.schema_front4),
    re_path(r'{}/front/(?P<p1>.*)$'.format(schemaName), views.schema_front1),
    re_path(r'{}/front/(?P<p1>.*)/(?P<p2>.*)$'.format(schemaName), views.schema_front2),
    re_path(r'{}/front/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)$'.format(schemaName), views.schema_front3),
    re_path(r'{}/front/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)/(?P<p4>.*)$'.format(schemaName), views.schema_front4),
    # re_path(r'assets/(?P<p1>.*)$', views.assets1),
    # re_path(r'assets/(?P<p1>.*)/(?P<p2>.*)$',  views.assets2),
    # re_path(r'assets/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)$',  views.assets3),
    # re_path(r'assets/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)/(?P<p4>.*)$',  views.assets4),
    #re_path(r'admin/(?P<p1>.*)$', views.admin_file1),
    re_path(r'admin/(?P<p1>.*)/(?P<p2>.*)$', views.admin_file2),
    re_path(r'admin/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)$', views.admin_file3),
    re_path(r'admin/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)/(?P<p4>.*)$', views.admin_file4),
    re_path(r'layui/(?P<p1>.*)$', views.layui1),
    re_path(r'layui/(?P<p1>.*)/(?P<p2>.*)$',  views.layui2),
    re_path(r'layui/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)$',  views.layui3),
    re_path(r'layui/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)/(?P<p4>.*)$',  views.layui4),
    re_path(r'pages/(?P<p1>.*)$', views.front_pages),
    re_path(r'pages/(?P<p1>.*)/(?P<p2>.*)$',  views.front_pages2),
    # re_path(r'pages/(?P<p1>.*)$',  views.front_file1),
    # re_path(r'(?P<p1>css|jss|img|image|iamges|font|fonts)/(?P<p2>.*)$', views.front_file2),
    re_path(r'modules/(?P<p1>.*)$', views.front_modules),
    re_path(r'css/(?P<p1>.*)$', views.css1),
    re_path(r'js/(?P<p1>.*)$', views.js1),
    re_path(r'img/(?P<p1>.*)$', views.img1),
    path(r'test/<str:p1>/',views.test),
    path(r'null',views.null),
]

#判断admin使用vue还是jquery
if os.path.isdir(os.path.join(os.getcwd(),"templates/front/admin/dist/")):
    urlpatterns.extend([
        path(r'{}/admin/dist/index.html'.format(schemaName),
             TemplateView.as_view(template_name='front/admin/dist/index.html')),
        path(r'{}/admin/'.format(schemaName), TemplateView.as_view(template_name='front/admin/dist/index.html')),
        # 以下是后台admin的url匹配规则
        path(r'admin/dist/index.html'.format(schemaName),
             TemplateView.as_view(template_name='front/admin/dist/index.html')),
        path(r'admin/', TemplateView.as_view(template_name='front/admin/dist/index.html')),
    ])
else:
    urlpatterns.extend([
        path(r'{}/admin/index.html'.format(schemaName),
             TemplateView.as_view(template_name='front/admin/index.html')),
        path(r'{}/admin/'.format(schemaName), TemplateView.as_view(template_name='front/admin/index.html')),
        # 以下是后台admin的url匹配规则
        path(r'admin/index.html'.format(schemaName),
             TemplateView.as_view(template_name='front/admin/index.html')),
        path(r'admin/', TemplateView.as_view(template_name='front/admin/index.html')),

    ])


if os.path.isfile(os.path.join(os.getcwd(),"templates/front/index.html")):
    urlpatterns.extend([
    path(r'index.html', TemplateView.as_view(template_name='front/index.html')),
     path(r'{}/index.html'.format(schemaName), TemplateView.as_view(template_name='front/index.html')),
     path(r'{}/front/index.html'.format(schemaName), TemplateView.as_view(template_name='front/index.html')),
    path(r'', TemplateView.as_view(template_name='front/index.html')),
    ])

4.3 config_v.py

python 复制代码
# coding:utf-8
__author__ = "ila"

import logging

from django.http import JsonResponse

from .config_model import config
from util.codes import *
from util import message as mes


def config_page(request):
    '''
    获取参数信息
    :return:
    '''
    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')
        msg['data']['list'], msg['data']['currPage'], msg['data']['totalPage'], msg['data']['total'], \
        msg['data']['pageSize'] = config.page(config, config, req_dict)
        return JsonResponse(msg)


def config_list(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")

        msg['data']['list'], msg['data']['currPage'], msg['data']['totalPage'], msg['data']['total'], \
        msg['data']['pageSize'] = config.page(config, config, req_dict)

        return JsonResponse(msg)


def config_info(request, id_):
    '''
    '''
    if request.method in ["POST", "GET"]:
        msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}

        data = config.getbyid(config, config, int(id_))
        if len(data) > 0:
            msg['data'] = data[0]
        return JsonResponse(msg)


def config_detail(request, id_):
    '''
    '''
    if request.method in ["POST", "GET"]:
        msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}

        data = config.getbyid(config, config, int(id_))
        if len(data) > 0:
            msg['data'] = data[0]
        return JsonResponse(msg)


def config_save(request):
    '''
    创建参数信息
    :return:
    '''
    if request.method in ["POST", "GET"]:
        msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}

        req_dict = request.session.get('req_dict')
        param1 = config.getbyparams(config, config, req_dict)
        if param1:
            msg['code'] = id_exist_code
            msg['msg'] = mes.id_exist_code
            return JsonResponse(msg)

        error = config.createbyreq(config, config, req_dict)
        logging.warning("save_config.res=========>{}".format(error))
        if error != None:
            msg['code'] = crud_error_code
            msg['msg'] = error
        return JsonResponse(msg)


def config_add(request):
    '''
    '''
    if request.method in ["POST", "GET"]:
        msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}
        req_dict = request.session.get("req_dict")

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


def config_update(request):
    '''
    更新参数信息
    :return:
    '''
    if request.method in ["POST", "GET"]:
        msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}

        req_dict = request.session.get('req_dict')

        config.updatebyparams(config, config, req_dict)

        return JsonResponse(msg)


def config_delete(request):
    '''
    删除参数信息
    :return:
    '''
    if request.method in ["POST", "GET"]:
        msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}

        req_dict = request.session.get('req_dict')
        config.deletes(config,
            config,
            req_dict.get("ids")
        )

        return JsonResponse(msg)

4.4 user_v.py

python 复制代码
# coding:utf-8
__author__ = "ila"

from django.http import JsonResponse

from .users_model import users
from util.codes import *
from util.auth import Auth
import util.message as mes
from dj2.settings import host,port,user,passwd,dbName,hasHadoop

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": "退出成功",
            "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__ != "否":

            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)


def users_info(request, id_):
    '''
    '''
    if request.method in ["POST", "GET"]:
        msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}

        data = users.getbyid(users, users, int(id_))
        if len(data) > 0:
            msg['data'] = data[0]
        # 浏览点击次数
        try:
            __browseClick__ = users.__browseClick__
        except:
            __browseClick__ = None

        if __browseClick__ and "clicknum" in users.getallcolumn(users, users):
            click_dict = {"id": int(id_), "clicknum": str(int(data[0].get("clicknum", 0)) + 1)}
            ret = users.updatebyparams(users, users, click_dict)
            if ret != None:
                msg['code'] = crud_error_code
                msg['msg'] = ret
        return JsonResponse(msg)


def users_save(request):
    '''
    '''
    if request.method in ["POST", "GET"]:
        msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}
        req_dict = request.session.get("req_dict")
        req_dict['role'] = '管理员'
        error = users.createbyreq(users, users, req_dict)
        if error != None:
            msg['code'] = crud_error_code
            msg['msg'] = error
        return JsonResponse(msg)


def users_update(request):
    '''
    '''
    if request.method in ["POST", "GET"]:
        msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}
        req_dict = request.session.get("req_dict")
        if req_dict.get("mima") and req_dict.get("password"):
            if "mima" not in users.getallcolumn(users,users):
                del req_dict["mima"]
            if "password" not in users.getallcolumn(users,users):
                del req_dict["password"]
        try:
            del req_dict["clicknum"]
        except:
            pass
        error = users.updatebyparams(users, users, req_dict)
        if error != None:
            msg['code'] = crud_error_code
            msg['msg'] = error
        return JsonResponse(msg)


def users_delete(request):
    '''
    '''
    if request.method in ["POST", "GET"]:
        msg = {"code": normal_code, "msg": mes.normal_code, "data": {}}
        req_dict = request.session.get("req_dict")

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

5、论文目录结构

摘要... I

Abstract... II

1 绪论... 1

1.1 项目简介... 1

1.2 调查研究... 1

1.2.1 研究背景及意义... 1

1.2.2 国内外研究现状... 2

1.2.3 研究主要内容... 2

1.3 论文的章节安排... 3

2 系统相关技术介绍... 4

2.1 Python语言... 4

2.2 Django框架... 4

2.3 Scrapy框架... 4

2.4 MySQL数据库... 4

3 系统需求分析... 6

3.1 可行性分析... 6

3.1.1 技术可行性... 6

3.1.2 经济可行性... 6

3.1.3 操作可行性... 6

3.2 系统功能需求... 6

3.2.1 用户端功能需求... 6

3.2.2 XX端功能需求... 6

3.2.3 管理员端功能需求... 6

3.3 系统性能需求... 6

4 系统总体设计... 7

4.1 系统总体架构设计... 7

4.2 系统的功能设计... 7

4.3 数据库设计... 7

4.3.1 概念设计E-R图... 7

4.3.2 逻辑设计关系模式... 7

4.3.3 数据库物理设计... 7

5 系统详细实现... 14

5.1 系统实现环境... 14

5.2 用户端... 14

5.2.1 登录页面... 14

5.2.2 注册页面... 14

5.2.3 XXXX页面... 14

5.2.4 XXXX页面... 14

5.2.5 XXXX页面... 14

5.3 XXXX端... 15

5.3.1 XXXX页面... 15

5.3.2 XXXX页面... 15

5.3.3 XXXX页面... 15

5.3.4 XXXX页面... 15

5.4 管理端... 15

5.4.1 用户管理页面... 15

5.4.2 XXXX页面... 15

5.4.3 XXXX页面... 16

5.4.4 XXXX页面... 16

6 系统测试... 16

6.1 测试目的... 16

6.2 测试方法... 16

6.3 测试用例... 16

6.3.1 XXXX测试... 16

6.3.2 XXXX测试... 16

6.4 测试结果... 16

结论... 17

参考文献... 18

致谢... 19

更多源码:

计算机毕业设计选题1000套等你来!!!

Python毕设精品项目

微信小程序毕设精品项目

大数据及机器学习毕设精品项目

6、源码获取

感谢大家的阅读,如有不懂的问题可以评论区交流或私聊!

喜欢文章可以点赞、收藏、关注、评论

下方联系方式扫描获取源码

相关推荐
Loong_DQX1 分钟前
[flask] flask-mail邮件发送
后端·python·flask
hummhumm16 分钟前
Oracle 第13章:事务处理
开发语言·数据库·后端·python·sql·oracle·database
童先生20 分钟前
python 用于请求chartGpt DEMO request请求方式
开发语言·python
Narutolxy3 小时前
探索开源语音识别的未来:高效利用先进的自动语音识别技术20241030
python·macos·xcode
Mopes__5 小时前
Python | Leetcode Python题解之第517题超级洗衣机
python·leetcode·题解
测试老哥7 小时前
Python+Selenium+Pytest+POM自动化测试框架封装(完整版)
自动化测试·软件测试·python·selenium·测试工具·职场和发展·测试用例
Ws_7 小时前
蓝桥杯 python day01 第一题
开发语言·python·蓝桥杯
神雕大侠mu8 小时前
函数式接口与回调函数实践
开发语言·python
王哲晓9 小时前
第六章 Vue计算属性之computed
前端·javascript·vue.js
萧鼎9 小时前
【Python】高效数据处理:使用Dask处理大规模数据
开发语言·python