Bootstrap

大数据毕业设计:python二手房数据分析可视化系统 链家网二手房 全国二手房 房源分析 爬虫 数据采集 Django框架 百万数据 大数据 计算机毕业设计 源码+文档(建议收藏)✅

博主介绍:✌全网粉丝10W+,前互联网大厂软件研发、集结硕博英豪成立工作室。专注于计算机相关专业项目实战6年之久,选择我们就是选择放心、选择安心毕业✌
> 🍅想要获取完整文章或者源码,或者代做,拉到文章底部即可与我联系了。🍅

点击查看作者主页,了解更多项目!

🍅感兴趣的可以先收藏起来,点赞、关注不迷路,大家在毕设选题,项目以及论文编写等相关问题都可以给我留言咨询,希望帮助同学们顺利毕业 。🍅

1、毕业设计:2025年计算机专业毕业设计选题汇总(建议收藏)✅

2、大数据毕业设计:2025年选题大全 深度学习 python语言 JAVA语言 hadoop和spark(建议收藏)✅

🍅感兴趣的可以先收藏起来,点赞、关注不迷路,大家在毕设选题,项目以及论文编写等相关问题都可以给我留言咨询,希望帮助同学们顺利毕业 。🍅

1、项目介绍

技术栈:
Django框架、Echarts可视化、链家网二手房、requests爬虫、全国城市、HTML、房源数据量 175万套

本系统是基于Python爬虫的二手房数据采集与可视化,整个系统可以大致分为五个部分,分别为Python爬虫、数据清洗、ECharts图表可视化、用户管理、后端管理。本系统的功能结构图如图所示

在这里插入图片描述

2、项目界面

(1)系统首页
在这里插入图片描述

(2)数据总览
在这里插入图片描述

(3)数据可视化分析1

在这里插入图片描述

(4)数据可视化分析2

在这里插入图片描述

(5)数据可视化分析3

在这里插入图片描述

(6)数据可视化分析4

在这里插入图片描述

(7)数据可视化分析5
在这里插入图片描述

(8)个人中心
在这里插入图片描述
(9)后台数据管理
在这里插入图片描述

(10)注册登录
在这里插入图片描述

3、项目说明

当今社会,房地产行业是一个备受关注的领域。随着人们对房屋信息需求的不断增加,二手房市场也越来越受到关注。基于此,本文旨在基于Python编程语言,采集全国省会城市二手房数据,并通过数据可视化的方式呈现数据分析结果。
本文的研究主要分为三个部分:数据采集、数据处理和数据可视化。在数据采集方面,本文采用Python爬虫为主要数据获取方式。在数据处理方面,通过Pandas对采集到的二手房数据进行了清洗和处理,包括数据去重、数据格式转换、数据缺失值处理等。在数据可视化方面,使用了ECharts图表库绘制了多种数据可视化图表,包括房价分布图、房屋面积分布图、房屋户型分布图等,通过这些图表直观地展示了二手房数据的分布情况和趋势分析。同时,本文使用Django框架作为后端开发语言,利用Django框架的MVT设计模式实现了二手房数据的采集、处理和存储,还使用了Bootstrap框架作为前端页面的设计框架,使得网页具有良好的视觉效果和用户体验,并实现了响应式布局,使得网页可以适应不同大小的屏幕和设备。通过本文的研究,可以为相关行业提供技术支持和参考,为购房者提供数据支持,从而做出更加适合自身的选择。

关键词:二手房;ECharts可视化;Python爬虫;Django框架

4、核心代码


from django.shortcuts import render,redirect
from django.core.paginator import Paginator  #django自带的分页工具库
from myApp.models import User
from .utils.error import *
import hashlib
from .utils import getHomeData,getSelfInfo,getChangePassword,getTableData,getHistoryData,getCharts
from .utils.error import *
from .utils.getPublicData import *



#登录
def login(request):
    if request.method == "GET":
        return render(request,'login.html')
    else:
        uname = request.POST.get('username')
        pwd = request.POST.get('password')
        md5 = hashlib.md5("aube".encode())             #加盐
        md5.update(pwd.encode())
        pwd = md5.hexdigest()
        try:
            user = User.objects.get(username=uname,password=pwd)
            request.session['username'] = user.username
            return redirect('/myApp/home')
        except:
            return errorResponse(request,'用户名或密码错误,请重新登录!')
    

#注册
def registry(request): 
    if request.method == "GET":
        return render(request,'registry.html')
    else:
        uname = request.POST.get('username')
        pwd = request.POST.get('password')
        checkPwd = request.POST.get('checkPassword')
        try:
            User.objects.get(username=uname)
        except:
            if not uname or not pwd or not checkPwd:
                return errorResponse(request,'用户名或密码不允许为空!')
            if pwd != checkPwd:                            #判断两次密码是否一致
                return errorResponse(request,'两次密码不一样,请确认密码后重试!')
            md5 = hashlib.md5("aube".encode())             #加盐
            md5.update(pwd.encode())
            pwd = md5.hexdigest()
            User.objects.create(username=uname,password=pwd)
            return redirect('/myApp/login')
        return errorResponse(request,'该用户名已经被占用!')


#退出登录
def logOut(request):
    request.session.clear()                                 #清除所有会话,在存储中删除值部分
    return redirect('/myApp/login')


#index界面
def home(request):
    uname = request.session.get('username')
    userInfo = User.objects.get(username=uname)
    year,month,day = getHomeData.getNowTime()
    #print(year,month,day)
    userCreateData = getHomeData.getUserCreateTime()
    top5Users = getHomeData.getUserTop5()
    count_cities,count_houses,count_users,highest_unit_price,highest_total,lowest_unit_price,lowest_total=getHomeData.getAllTags()
    house_count_list = getHomeData.getHouseCount()
    return render(request,'index.html',{
                    'userInfo':userInfo,                                #用户信息 
                    'dateInfo':{'year':year,'month':month,'day':day},   #当前日期  
                    'userCreateData':userCreateData,                    #用户创建日期
                    'top5Users':top5Users,                              #最新注册用户数据
                    'allTags':{'count_cities':count_cities,             #城市数
                               'count_houses':count_houses,             #房源数
                               'count_users':count_users,               #用户数
                               'highest_unit_price':highest_unit_price, #最大单价
                               'highest_total':highest_total,           #最大总价
                               'lowest_unit_price':lowest_unit_price,   #最低单价
                               'lowest_total':lowest_total,             #最低总价
                               },
                    'house_count_list':house_count_list,                #城市房源数量
    }) 


#个人信息
def selfInfo(request):
    uname = request.session.get('username')
    userInfo = User.objects.get(username=uname)
    if request.method == 'POST':
        getSelfInfo.changeSelfInfo(request.POST,request.FILES)
        userInfo = User.objects.get(username=uname)
    return render(request,'selfInfo.html',{
        'userInfo':userInfo
    })


#修改密码
def changePassword(request):
    uname = request.session.get('username')
    userInfo = User.objects.get(username=uname)
    if request.method == 'POST':
        res = getChangePassword.changePassword(userInfo,request.POST)
        if res != None:
            return errorResponse(request,res)
        userInfo = User.objects.get(username=uname)
    return render(request,'changePassword.html',{
        'userInfo':userInfo
    })


#数据总览
def tableData(request):
    uname = request.session.get('username')
    userInfo = User.objects.get(username=uname)
    tableData = getTableData.getTableData()
    paginator = Paginator(tableData,10)
    cur_page = 1
    if request.GET.get('page'):
        cur_page = int(request.GET.get('page'))
    c_page = paginator.page(cur_page)
    page_range = []
    visibleNumber = 10
    min = int(cur_page - visibleNumber / 10)
    if min < 1:
        min = 1
    max = min + visibleNumber
    #print(paginator.page_range)
    if max > paginator.page_range[-1]:
        max = paginator.page_range[-1]
    for i in range(min,max):
        page_range.append(i)
    #print(page_range)

    # for i in c_page: 
    #     print(i['id'])
    # for i in tableData:
    #     print(i['areaname'])
    #     break
    return render(request,'tableData.html',{
        'userInfo':userInfo,
        'c_page':c_page,
        'page_range':page_range,
        'paginator':paginator,
    })


#添加历史查阅
def addHistory(request,houseId):
    uname = request.session.get('username')
    userInfo = User.objects.get(username=uname)
    getHistoryData.addHistory(userInfo,houseId)
    return redirect('tableData')


#历史查阅
def historyTableData(request):
    uname = request.session.get('username')
    userInfo = User.objects.get(username=uname)
    historyTableData = getHistoryData.getHistoryData(userInfo)
    #print(historyTableData)
    return render(request,'historyTableData.html',{
        'userInfo':userInfo,
        'historyTableData':historyTableData,
    })


#删除历史查阅
def removeHistory(request,hisId):
    getHistoryData.removeHistory(hisId)
    return redirect('historyTableData')


#可视化
def haikouData(request):
    uname = request.session.get('username')
    userInfo = User.objects.get(username=uname)
    city_name='北京'
    city_obj=haikou
    area_unitprice_sort,base0_list,area_houses_num_list,base6_num_list,indicator,total_tag,total_data_list,area_tag,area_list,price_list,trafficWay,transaction1_data,transaction0_keys,transaction0_values,word_counts_data = getCharts.getChartData(city_obj)
    return render(request,'chart.html',{
        'userInfo':userInfo,
        'area_unitprice_sort_keys':[i for i,j in area_unitprice_sort],
        'city_name':city_name,
        'area_unitprice_sort_values':[j for i,j in area_unitprice_sort],
        'base0_list':base0_list,
        'area_houses_num_list':area_houses_num_list,
        'base6_num_list':base6_num_list,
        'indicator':indicator,
        'total_tag':total_tag,
        'total_data_list':total_data_list,
        'area_tag':area_tag,
        'area_list':area_list,
        'price_list':price_list,
        'trafficWay':trafficWay,
        'transaction1_data':transaction1_data,
        'transaction0_keys':transaction0_keys,
        'transaction0_values':transaction0_values,
        'word_counts_data':word_counts_data
    })


5、源码获取方式

🍅由于篇幅限制,获取完整文章或源码、代做项目的,查看【用户名】、【专栏名称】就可以找到我啦🍅

感兴趣的可以先收藏起来,点赞、关注不迷路,下方查看👇🏻获取联系方式👇🏻

;