目 录
摘 要 I
Abstract II
第1章 绪论 1
1.1 课题研究背景 1
1.2研究现状 2
1.3课题研究内容及思路 3
第2章 系统需求分析 5
2.1系统的性能要求 5
2.2系统功能需求分析 5
2.2.1功能划分 5
2.2.2功能描述 8
2.3技术可行性分析 10
2.4相关技术简介 11
2.4.1 B/S体系相关介绍 11
2.4.2 Python语言介绍 12
3.4.3 Djang框架介绍 12
2.5技术方案选择 13
2.6开发环境的确定 14
第3章 系统设计 15
3.1系统体系结构设计 15
3.2数据库表的设计 16
第4章 系统实现 22
4.1用户注册 22
4.2系统登录 25
4.3课程首页 27
4.5授课机构 32
4.6上传资料 40
4.7公开课 45
4.8修改密码 48
第5章 总结 50
5.1系统主要特色 50
5.2系统存在的不足 50
参考文献 51
致 谢 52
1.3课题研究内容及思路
学习分为正式学习和非正式学习。正式学习主要是指通过学校组织、课堂授课等形式实现的学习形态,它通常是有计划性的、有明确的目标和课程知识体系,学习的目的是获取成绩、证书,并为将来的工作做准备。非正式学习指受内在心理或外在情境触动而引发的学习形式,它有明确的学习意图,即解决当前遇到的问题,因而与实践的需要密切相关,从而获得能够立即应用到实践当中去的知识和技能。
基于Django框架的在线教育平台的设计与实现遵循的一个主要思路就是:辅助正式学习、方便非正式学习。
实现教学资源共享,辅助学生进行正式学习。教师将每次课的重点、难点、讲稿与在备课期间收集的与课程内容相关的学习视频和大量的实例练习等教学资源有序地上传到网络教学平台上,结合课上讲授的知识点,学生根据自身的情况在对这些教学资源进行有针对性的自主学习。
提供交流互动功能,方便学生进行非正式学习。学生、教师能够通过系统对非正式学习过程中遇到的问题进行方便的在线或离线交流,同时对讨论话题、内容进行整理、分析,得出普遍问题,形成常见问题库,避免重复讨论。
本平台基于Django框架开发,Django是一个由Python编写的具有完整架站能力的开源Web框架。Django本身基于MTV模型,即Model(模型)+Template
(模版)+View(视图)设计模式,因此Django继承了MTV开发快捷、部署方便、可重用性高、维护成本低等优点。对比Java其他框架,虽然他有完美的IDE,活跃的社区,强大稳定的应用服务器,高性能的jvm解释器,但是使用Django的主要目的是简便、快速的开发数据库驱动的网站。它强调代码复用,多个组件可以很方便的以“插件”形式服务于整个框架,Django有许多功能强大的第三方插件,你甚至可以很方便的开发出自己的工具包。Django具有很强的可扩展性。该系统充分利用Django的优点,具有友好的人机界面,使学员可以轻松地在网上学习,采用流媒体技术对视频进行处理转换,限制了上传视频大小,还具有评论功能,在使用过程中其结果让人非常满意,在功能上也是十分全面,并且具有一定的可拓展性和移植性,是一个较好的在线学习系统。本文转载自http://www.biyezuopin.vip/onews.asp?id=11762系统最先在中心内部实现并且正常运行,也可拓展应用整个培训系统。在现有功能基础上,还进行改进,增加以班级为单位的培训课程和学员注册功能,增强安全性能,使其成为一个功能更加完备的在线教育系统。

# coding:utf-8
import os
import json
import random
try:# python3import urllib.request as urllibfrom urllib.request import urljoin as urljoin
except:# python2import urllibfrom urllib import basejoin as urljoin
import datetime
from django.http import HttpResponse
from . import settings as USettings
from django.views.decorators.csrf import csrf_exemptdef get_path_format_vars():return {"year": datetime.datetime.now().strftime("%Y"),"month": datetime.datetime.now().strftime("%m"),"day": datetime.datetime.now().strftime("%d"),"time": datetime.datetime.now().strftime("%H%M%S"),"datetime": datetime.datetime.now().strftime("%Y%m%d%H%M%S"),"rnd": random.randrange(100, 999)}# 保存上传的文件
def save_upload_file(PostFile, FilePath):try:f = open(FilePath, 'wb')for chunk in PostFile.chunks():f.write(chunk)except Exception as e:f.close()return u"写入文件错误:%s" % ef.close()return u"SUCCESS"@csrf_exempt
def get_ueditor_settings(request):return HttpResponse(json.dumps(USettings.UEditorUploadSettings, ensure_ascii=False), content_type="application/javascript")@csrf_exempt
def get_ueditor_controller(request):"""获取ueditor的后端URL地址    """action = request.GET.get("action", "")reponseAction = {"config": get_ueditor_settings,"uploadimage": UploadFile,"uploadscrawl": UploadFile,"uploadvideo": UploadFile,"uploadfile": UploadFile,"catchimage": catcher_remote_image,"listimage": list_files,"listfile": list_files}return reponseAction[action](request)@csrf_exempt
def list_files(request):"""列出文件"""if request.method != "GET":return HttpResponse(json.dumps(u"{'state:'ERROR'}"), content_type="application/javascript")# 取得动作action = request.GET.get("action", "listimage")allowFiles = {"listfile": USettings.UEditorUploadSettings.get("fileManagerAllowFiles", []),"listimage": USettings.UEditorUploadSettings.get("imageManagerAllowFiles", [])}listSize = {"listfile": USettings.UEditorUploadSettings.get("fileManagerListSize", ""),"listimage": USettings.UEditorUploadSettings.get("imageManagerListSize", "")}listpath = {"listfile": USettings.UEditorUploadSettings.get("fileManagerListPath", ""),"listimage": USettings.UEditorUploadSettings.get("imageManagerListPath", "")}# 取得参数list_size = int(request.GET.get("size", listSize[action]))list_start = int(request.GET.get("start", 0))files = []root_path = os.path.join(USettings.gSettings.MEDIA_ROOT, listpath[action]).replace("\\", "/")files = get_files(root_path, root_path, allowFiles[action])if (len(files) == 0):return_info = {"state": u"未找到匹配文件!","list": [],"start": list_start,"total": 0}else:return_info = {"state": "SUCCESS","list": files[list_start:list_start + list_size],"start": list_start,"total": len(files)}return HttpResponse(json.dumps(return_info), content_type="application/javascript")def get_files(root_path, cur_path, allow_types=[]):files = []items = os.listdir(cur_path)for item in items:item = unicode(item)item_fullname = os.path.join(root_path, cur_path, item).replace("\\", "/")if os.path.isdir(item_fullname):files.extend(get_files(root_path, item_fullname, allow_types))else:ext = os.path.splitext(item_fullname)[1]is_allow_list = (len(allow_types) == 0) or (ext in allow_types)if is_allow_list:files.append({"url": urljoin(USettings.gSettings.MEDIA_URL, os.path.join(os.path.relpath(cur_path, root_path), item).replace("\\", "/")),"mtime": os.path.getmtime(item_fullname)})return files@csrf_exempt
def UploadFile(request):"""上传文件"""if not request.method == "POST":return HttpResponse(json.dumps(u"{'state:'ERROR'}"), content_type="application/javascript")state = "SUCCESS"action = request.GET.get("action")# 上传文件upload_field_name = {"uploadfile": "fileFieldName", "uploadimage": "imageFieldName","uploadscrawl": "scrawlFieldName", "catchimage": "catcherFieldName","uploadvideo": "videoFieldName",}UploadFieldName = request.GET.get(upload_field_name[action], USettings.UEditorUploadSettings.get(action, "upfile"))# 上传涂鸦,涂鸦是采用base64编码上传的,需要单独处理if action == "uploadscrawl":upload_file_name = "scrawl.png"upload_file_size = 0else:# 取得上传的文件file = request.FILES.get(UploadFieldName, None)if file is None:return HttpResponse(json.dumps(u"{'state:'ERROR'}"), content_type="application/javascript")upload_file_name = file.nameupload_file_size = file.size# 取得上传的文件的原始名称upload_original_name, upload_original_ext = os.path.splitext(upload_file_name)# 文件类型检验upload_allow_type = {"uploadfile": "fileAllowFiles","uploadimage": "imageAllowFiles","uploadvideo": "videoAllowFiles"}if action in upload_allow_type:allow_type = list(request.GET.get(upload_allow_type[action], USettings.UEditorUploadSettings.get(upload_allow_type[action], "")))if upload_original_ext not in allow_type:state = u"服务器不允许上传%s类型的文件。" % upload_original_ext# 大小检验upload_max_size = {"uploadfile": "filwMaxSize","uploadimage": "imageMaxSize","uploadscrawl": "scrawlMaxSize","uploadvideo": "videoMaxSize"}max_size = int(request.GET.get(upload_max_size[action], USettings.UEditorUploadSettings.get(upload_max_size[action], 0)))if max_size != 0:from .utils import FileSizeMF = FileSize(max_size)if upload_file_size > MF.size:state = u"上传文件大小不允许超过%s。" % MF.FriendValue# 检测保存路径是否存在,如果不存在则需要创建upload_path_format = {"uploadfile": "filePathFormat","uploadimage": "imagePathFormat","uploadscrawl": "scrawlPathFormat","uploadvideo": "videoPathFormat"}path_format_var = get_path_format_vars()path_format_var.update({"basename": upload_original_name,"extname": upload_original_ext[1:],"filename": upload_file_name,})# 取得输出文件的路径OutputPathFormat, OutputPath, OutputFile = get_output_path(request, upload_path_format[action], path_format_var)# 所有检测完成后写入文件if state == "SUCCESS":if action == "uploadscrawl":state = save_scrawl_file(request, os.path.join(OutputPath, OutputFile))else:# 保存到文件中,如果保存错误,需要返回ERRORstate = save_upload_file(file, os.path.join(OutputPath, OutputFile))# 返回数据return_info = {# 保存后的文件名称'url': urljoin(USettings.gSettings.MEDIA_URL, OutputPathFormat),# 原始文件名'original': upload_file_name,'type': upload_original_ext,# 上传状态,成功时返回SUCCESS,其他任何值将原样返回至图片上传框中'state': state,'size': upload_file_size}return HttpResponse(json.dumps(return_info, ensure_ascii=False), content_type="application/javascript")@csrf_exempt
def catcher_remote_image(request):"""远程抓图,当catchRemoteImageEnable:true时,如果前端插入图片地址与当前web不在同一个域,则由本函数从远程下载图片到本地"""if not request.method == "POST":return HttpResponse(json.dumps(u"{'state:'ERROR'}"), content_type="application/javascript")state = "SUCCESS"allow_type = list(request.GET.get("catcherAllowFiles", USettings.UEditorUploadSettings.get("catcherAllowFiles", "")))max_size = int(request.GET.get("catcherMaxSize", USettings.UEditorUploadSettings.get("catcherMaxSize", 0)))remote_urls = request.POST.getlist("source[]", [])catcher_infos = []path_format_var = get_path_format_vars()for remote_url in remote_urls:# 取得上传的文件的原始名称remote_file_name = os.path.basename(remote_url)remote_original_name, remote_original_ext = os.path.splitext(remote_file_name)# 文件类型检验if remote_original_ext in allow_type:path_format_var.update({"basename": remote_original_name,"extname": remote_original_ext[1:],"filename": remote_original_name})# 计算保存的文件名o_path_format, o_path, o_file = get_output_path(request, "catcherPathFormat", path_format_var)o_filename = os.path.join(o_path, o_file).replace("\\", "/")# 读取远程图片文件try:remote_image = urllib.urlopen(remote_url)# 将抓取到的文件写入文件try:f = open(o_filename, 'wb')f.write(remote_image.read())f.close()state = "SUCCESS"except Exception as e:state = u"写入抓取图片文件错误:%s" % eexcept Exception as e:state = u"抓取图片错误:%s" % ecatcher_infos.append({"state": state,"url": urljoin(USettings.gSettings.MEDIA_URL, o_path_format),"size": os.path.getsize(o_filename),"title": os.path.basename(o_file),"original": remote_file_name,"source": remote_url})return_info = {"state": "SUCCESS" if len(catcher_infos) > 0 else "ERROR","list": catcher_infos}return HttpResponse(json.dumps(return_info, ensure_ascii=False), content_type="application/javascript")def get_output_path(request, path_format, path_format_var):# 取得输出文件的路径OutputPathFormat = (request.GET.get(path_format, USettings.UEditorSettings["defaultPathFormat"]) % path_format_var).replace("\\", "/")# 分解OutputPathFormatOutputPath, OutputFile = os.path.split(OutputPathFormat)OutputPath = os.path.join(USettings.gSettings.MEDIA_ROOT, OutputPath)# 如果OutputFile为空说明传入的OutputPathFormat没有包含文件名,因此需要用默认的文件名if not OutputFile:OutputFile = USettings.UEditorSettings["defaultPathFormat"] % path_format_varOutputPathFormat = os.path.join(OutputPathFormat, OutputFile)if not os.path.exists(OutputPath):os.makedirs(OutputPath)return (OutputPathFormat, OutputPath, OutputFile)# 涂鸦功能上传处理
@csrf_exempt
def save_scrawl_file(request, filename):import base64try:content = request.POST.get(USettings.UEditorUploadSettings.get("scrawlFieldName", "upfile"))f = open(filename, 'wb')f.write(base64.decodestring(content))f.close()state = "SUCCESS"except Exception as e:state = u"写入图片文件错误:%s" % ereturn state













在线教育平台的开发与设计(Python+Django+MySQL)相关推荐

  1. 一般的在线教育平台需具备哪些功能?

    教育信息化的提倡让越来越多的信息技术成果被应用到教育行业,互联网+教育一步步走入基础教育.高等教育.职业教育甚至是继续教育的方方面面.对于互联网+教育的实现,人们最常见的就是在线教育平台系统搭建了,对 ...

  2. Java怎么做三端_Java三端分离开发在线教育平台

    第1章 课程项目整体概述(整体介绍及Eclipse,Maven,新浪SAE软件平台介绍) 系统通过maven构建一个portal站,在sae上部署,让同学们感受一下互联网应用的魅力: 1-1 --课程 ...

  3. 计算机毕业设计springboot基于Springboot的在线教育平台的设计与实现8qecq源码+系统+程序+lw文档+部署

    计算机毕业设计springboot基于Springboot的在线教育平台的设计与实现8qecq源码+系统+程序+lw文档+部署 计算机毕业设计springboot基于Springboot的在线教育平台 ...

  4. 在线教育平台架构设计

    1.    目的 1.1.    目的 该架构设计主要针对在线教育平台建设过程中的核心需求进行设计,作为架构.设计.开发.测试.运维人员对系统的认识参考. 1.2.    名词解析: 系统:一个软件. ...

  5. android在线教学,基于Android的移动在线教育平台的设计与实现

    申晋祥+鲍美英 摘要:移动学习是目前互联网时代的一种新型学习方式.本文设计并实现了一个支持移动学习的在线教育平台,该平台基于Android系统,采用多线程技术应用Java语言进行开发,开发工具采用Ec ...

  6. 在线教育平台开发需求分析

    随着互联网的不断发展,现代信息技术向教育行业迅速扩展,教育的方式也不再是传统面对面的书本传授了,线下模式正面临着前所未有的严峻挑战,同时也面临着前良好的发展机遇-在线教育平台开发需求旺盛.它打破了传统 ...

  7. 在线教育平台开发:线上教育前景预测

    说起在线教育平台开发相信大家都不会陌生,它包通过现今的数字化技术实现视频.音频.图片.文字.声音的同步传输,方便快捷地实现师生在网络上的交互学习.有些人将在线教育归类于现代远程教育,总而言之在线教育是 ...

  8. Django项目于之在线教育平台网站的实战开发(三)

    说明:该篇博客是博主一字一码编写的,实属不易,请尊重原创,谢谢大家! 接着上一篇博客继续往下写 :Django项目于之在线教育平台网站的实战开发(二)_cdtaogang's blog-CSDN博客 ...

  9. 在线教育平台开发的“前世今生”

    在线教育平台开发的发展史还要从最早时期的教育说起.当时教育的标签是小范围且没有固定概念的,后来成熟之后推行的私塾制,师傅会教导徒弟,可以换算成如今的师生关系,譬如当时孔子的门下共有七十二个学生,学生的 ...

最新文章

  1. 【Qt】Qt中使用ssl时报错:qt.network.ssl: QSslSocket: cannot resolve SSLv2_client_method
  2. Attention Model(注意力模型)思想初探
  3. 谈谈神秘的ES6——(一)初识ECMAScript
  4. 皮一皮:考试了,全国统一舔狗学校招生考试!
  5. 【Python】青少年蓝桥杯_每日一题_7.03_输出符合要求的字母
  6. 适用于WinForm的一个定时器类
  7. JAVA中利用DOM解析XML文档
  8. python可以写安卓应用吗_python可以编写android程序吗?
  9. linux中Centos7搭建lnmp环境
  10. db2查最新值的前一天值_贵阳6月最新二手房房价出炉!快看你家房子值多少钱?...
  11. JAVA中DecimalFormat如何进行四舍五入?
  12. DES加密/解密类。
  13. activiti配置文件activiti.cfg.xml
  14. 性能测试之工具对比-ngrinder jmeter loadunner及ngrinder安装使用方法
  15. 学吉他该如何科学背谱?
  16. 麦吉尔大学计算机科学申请,加拿大麦吉尔大学计算机科学硕士成功案例分享
  17. 以太网没有有效的IP配置
  18. LeetCode,无它,唯手熟尔(三)
  19. 基本概念学习(9013)---通用寄存器、机器字长、数据通路
  20. 【Druid】(八)Apache Druid 核心插件 Kafka Indexing Service SLS Indexing Service

热门文章

  1. Struts2创建详细教程
  2. 淘宝双11数据分析与预测汇总
  3. c语言中0,‘0’,‘\0’的区别
  4. maven jar包 私服 拉去问题,加载jar包时报错ReasonPhrase:unauthorized
  5. python process参数_将参数传递给Scrapy python中的process.crawl
  6. 动态规划训练1-天天向上
  7. printf用法大全,C语言printf格式控制符一览表printf用法大全,C语言printf格式控制符一览表
  8. qml学习---------------Button属性
  9. 怎么在 CSDN 写好技术博客
  10. 评价模型——模糊综合评价