14、python_django_web开发_app models分层与users数据模型设计完成_笔记
授课机构 授课老师 可以对 公开课 授课老师 授课机构 进行全局搜索 app设计: users 用户管理 Course 课程管理 organization 授课机构和其教师的管理 operation 用户操作管理 为什么多出这个app呢?后面说 数据库设计 Pip install django==1.9 为什么不用1.10 因为搭建后台管理系统框架目前只支持1.9 搜索 users app的models设计: Django默认数据表:auth_user 如果这张表不能满足 则需要扩展 继承系统的 AbstractUser Settings 文件中 AUTH_USER_MODEL = 'users.UserProfile' ImageField must Pillow Pip install pillow auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes with reverse accessor for 'UserProfile.groups'. HINT: Add or change a related_name argument to the definition for 'User.groups' or 'UserProfile.groups'. auth.User.user_permissions: django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency users.0001_initial on database 'default'. SyntaxError: Non-ASCII character '\xe6' in file /Users/dinglx/Desktop/django_works/izengzhi/apps/users/models.py on line 10, but no encoding declared; # -*- coding: utf-8 -*- 循环引用 User models.py (UserCourse) 用户学习的课程 Courses models.py(CourseComment) 死循环 更上一层的app:operation 为了避免循环import 上层app是可以引用下一层models的 邮箱注册或找回密码是 保存验证码到数据库 EmailVerifyCode 邮箱验证码 PageBanner 轮播图
|