OpenEdx证书功能的启用

     在OpenEdx(Ginkgo)的CMS界面中,课程管理的URL为/course/course-v1:edX+DemoX+Demo_Course,开始查找对应的URL文件。在urls.py文件中找了
url(r’^course/{}?$’.format(settings.COURSE_KEY_PATTERN), ‘course_handler’, name=’course_handler’),顺便看下COURSE_KEY_PATTERN的内容,在lms/envs/common.py文件中找到如下定义
COURSE_KEY_PATTERN = r'(?P<course_key_string>[^/+]+(/|\+)[^/+]+(/|\+)[^/?]+)’

继续阅读OpenEdx证书功能的启用

关于OpenEdx用户类型的说明

这个内容实在stackoverflow网站上找到的
Users are automatically enrolled as “honor”. Honor code certificates are free of charge to all students and are available for all except a few specific courses.
An honor code certificate of achievement certifies that you have successfully completed a course, but does not verify your identity (ref).

继续阅读关于OpenEdx用户类型的说明

OpenEdx的购物车分析(ginkgo.1)

1、OpenEdx的购物车代码在lms/djangoapps/models.py文件中,首先分析模型:
class Order               #订单(含有一批物品)
class OrderItem       #订单中的一个物品,有一个外键 order指向Order类。
其中Order是用户的订单,其中Order.status为用户订单的状态。如果status==’cart’,则意味着该订单还未结算,物品仍在购物车。如果status==’paying’ 则意味着进入支付状态,此时相关信息不可修改。
2、两个和优惠码有关的类
class Coupon
class CouponRedemption   #优惠码赎回,因该是用户使用过的优惠码存储的地方。

ffmpeg音视频合成

Merging video and audio, with audio re-encoding

See this example, taken from this blog entry but updated for newer syntax. It should be something to the effect of:
ffmpeg -i video.mp4 -i audio.wav \
-c:v copy -c:a aac -strict experimental output.mp4
Here, we assume that the video file does not contain any audio stream yet, and that you want to have the same output format (here, MP4) as the input format.
The above command transcodes the audio, since MP4s cannot carry PCM audio streams. You can use any other desired audio codec if you want. See the AAC Encoding Guide for more info.

继续阅读ffmpeg音视频合成

在安装多个python的环境中用制定的版本的解释器运行程序

       由于Python的相关库版本众多,且库之间还有较大的差异。因此一个经常遇到的场景是在一台机器上使用”virtualenv”安装多个python环境,并用指定的python来执行某些程序。在人机交互的时候可以通过命令”source ./v1en/bin/active”进入相应的环境并执行程序,但有时需要用系统的定时任务crontab和supervisor来做这些事情。如下是对应的解决办法:
      在执行程序时直接写上带有绝对路径的python名称和对应的程序名称,例如
       /home/abc/v1env/bin/python /app/hello/abc.py
       如果程序所在的目录需要加入PYTHONPATH中则需要先进入这个目录,例如
       cd /app/hello/  &&  /home/abc/v1env/bin/python /app/hello/abc.py

关于React和DRF的整合(修改分页后返回的内容)

       对于前端的表格数据,需要返回数据本身的序号,不是这个记录的ID。如果直接使用DRF的序列化功能则不能产生这个序号,因此要对DRF内置的ListModelMixin类进行修改。

继续阅读关于React和DRF的整合(修改分页后返回的内容)