Django + xadmin build online education platform (a)

A: needs analysis

  • The system has a complete user registration and login password recovery feature, complete with individual centers.
  • Personal center: Modify avatar, change passwords, modify the mailbox, you can see my courses and my collection. You can delete collections, from me.
  • Navigation bar: open class, instructor, teaching institutions, global search.
  • Click 公开课-> Course list, sort - search. Popular courses recommended, paging courses.
  • Click 课程-> Course Details page of the curriculum collection, canceled collection. Rich text display course content.
  • Click 开始学习-> Comment chapter information, course curriculum. Download Link curriculum resources.
  • Click 授课讲师-> instructor list page, for sorting and paging popular lecturers, lecturers have the right list.
  • Click 讲师的详情页面-> to lecturers collection and sharing, as well as a full course instructor.
  • Navigation bar: teaching institutions paging, sorting, filtering capabilities.
  • The right of agencies List quick form is submitted I want to learn.
  • Click 机构-> Left: Home institution, agency programs, agencies reports, the agency lecturer.
  • Background management system can be 切换主题. Each function has a left side of the display list, CRUD, filtering capabilities.
  • Course List page can be sorted in different fields. Select multiple records delete operation.
  • Course List: Filter -> select field scope, search, export csv, xml, json.
  • Course upload pictures to add pages, edit rich text. Timing, adding chapters, add curriculum resources.
  • Logging: Record operating backstage staff

Two: Database Design

 (Move the mouse to the picture, the right to open a new window to view a larger HD)

 Development projects are models from the beginning design, management and rendering the front of the background is nothing more than a database of additions and deletions to change search, so crucial factor models design quality plays on the development of the entire project.

Three: Hands

1. Create a project

  Creating (1) command line

django-admin startproject MxOnline

  (2) use to create pycharm

 

2.创建应用 

   在pycharm打开终端,依次输入以下命令,创建四个APP 

python manage.py startapp users

python manage.py startapp course

python manage.py startapp organization

python manage.py startapp operation

3.编写model代码

(1)users 用户

  由于Django有自己的一套认证权限系统,当然包括user表了,所以我们只需要在其基础上增加功能即可。

  系统自动生成的user表字段如下:

    id:主键

    password:密码

    is_superuser:是否为超级用户(后台管理)

    username 用户名字段不要随便改动

    email 邮箱

    is_staff 表示是否是员工(后台管理)

    is_active 用户是否是激活状态

    date_joined 注册时间

  所以我们只需要继承AbstractUser类

 

Guess you like

Origin www.cnblogs.com/huiyichanmian/p/11204439.html