Code Monkey home page Code Monkey logo

courseonline's Introduction

Django 编写线上教育平台

项目 APP 设计

  • django app设计
    1、users 用户
    2、courses 课程
    3、organization 教育机构和教师
    4、operation 组合其他的app

##新建APP

  • 1、Pycharm 中:Tools -> Rum manage.py Task -> startapp app_name
  • 2、terminal中:cd 到项目的根目录 -> startapp app_name

User app

###user表的编写(要覆盖原有的user表)

  • 覆盖原有的user表 from django.contrib.auth.models import AbstractUser
    编写自己的UserProfile继承AbstractUser

课程 app

###表的编写

  • Course - 课程基本信息
  • Lesson - 章节信息
  • Video - 视频
  • CourseResource - 课程资源(课程源码什么的)

###Django中外键的使用

  • Class Course(models.Model):
    //TODO
    Class CourseResource(models.Model):
    course = models.ForeignKey(Course,verbose_name=u"课程")

后台管理系统

特点:

  • 权限管理
  • 少前端样式
  • 快速开发

##出现的问题

1、把apps文件夹Mark为Sources Root,在项目的导入中没有问题,但是在用本地的Python运行时却会报错

  • 因为本地Python是不知道我们把apps这个文件夹作为了资源的根目录的,所以Python在读取module时找不到我们自己定义的APP
  • 我们应该告诉Python我们把那些文件夹作为了SourcesRoot,那么怎么告诉呢,在setting中定义(18-19)行,这里我就不写了

##使用xadmin

courseonline's People

Contributors

thrsky avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.