Django 用户管理相关的表:

  1. create table django_content_type (
  2. /*
  3. 内容类型表
  4. */
  5. id int(11) not null auto_increment,
  6. app_label varchar(100) not null,
  7. model varchar(100) not null,
  8.  
  9. primary key (id),
  10. unique key uix_django_content_type_app_lable_model (app_label,model)
  11. )
  12.  
  13. -- select * from django_content_type;
  14. -- +----+--------------+-------------+
  15. -- | id | app_label | model |
  16. -- +----+--------------+-------------+
  17. -- | 1 | admin | logentry |
  18. -- | 3 | auth | group |
  19. -- | 2 | auth | permission |
  20. -- | 4 | auth | user |
  21. -- | 5 | contenttypes | contenttype |
  22. -- | 6 | sessions | session |
  23. -- +----+--------------+-------------+
  24.  
  25. create table auth_permission (
  26. /*
  27. 权限表
  28. */
  29. id int(11) not null auto_increment,
  30. name varchar(255) not null,
  31. content_type_id int(11) not null,
  32. codename varchar(100) not null,
  33.  
  34. primary key (id),
  35. unique key uix__auth_permission_content_type_id_codename (content_type_id,codename),
  36. constraint uix__auth_permission_content_type_id foreign key (content_type_id) references django_content_type (id)
  37. )
  38.  
  39. create table auth_user (
  40. /*
  41. 用户
  42. */
  43. id int(11) not null auto_increment,
  44. password varchar(128) not null,
  45. last_login datetime(6) DEFAULT NULL,
  46. is_superuser tinyint(1) not null,
  47. username varchar(150) not null,
  48. first_name varchar(30) not null,
  49. last_name varchar(150) not null,
  50. email varchar(254) not null,
  51. is_staff tinyint(1) not null,
  52. is_active tinyint(1) not null,
  53. date_joined datetime(6) not null,
  54.  
  55. primary key (id),
  56. unique key username (username)
  57. )
  58.  
  59. create table auth_group (
  60. /*
  61. 用户组
  62. */
  63. id int(11) not null auto_increment,
  64. name varchar(80) not null,
  65.  
  66. primary key (id),
  67. unique key name (name)
  68. )
  69.  
  70. create table auth_user_groups (
  71. /*
  72. 用户 + 组 关联关系表
  73. */
  74. id int(11) not null auto_increment,
  75. user_id int(11) not null,
  76. group_id int(11) not null,
  77.  
  78. primary key (id),
  79. unique key uix__auth_user_groups_user_id_group_id (user_id,group_id),
  80. key ix_auth_user_groups_group_id (group_id),
  81. constraint fk_auth_user_groups_group_id foreign key (group_id) references auth_group (id),
  82. constraint fk_auth_user_groups_user_id foreign key (user_id) references auth_user (id)
  83. )
  84.  
  85. create table auth_user_user_permissions (
  86. /*
  87. 用户权限
  88. */
  89. id int(11) not null auto_increment,
  90. user_id int(11) not null,
  91. permission_id int(11) not null,
  92.  
  93. primary key (id),
  94. unique key uix_auth_user_user_permissions_user_id_permission_id (user_id,permission_id),
  95. key ix_auth_user_user_permissions_permission_id (permission_id),
  96. constraint fk_auth_user_user_permissions_permission_id foreign key (permission_id) references auth_permission (id),
  97. constraint fk_auth_user_user_permissions_user_id foreign key (user_id) references auth_user (id)
  98. )
  99.  
  100. create table auth_group_permissions (
  101. /*
  102. 组权限
  103. */
  104. id int(11) not null auto_increment,
  105. group_id int(11) not null,
  106. permission_id int(11) not null,
  107.  
  108. primary key (id),
  109. unique key uix_auth_group_permissions (group_id,permission_id),
  110. key ix__auth_group_permissions_permission_id (permission_id),
  111.  
  112. constraint fk__auth_group_permissions_auth_permission_id foreign key (permission_id) references auth_permission (id),
  113. constraint fk__auth_group_permissions_auth_group_id foreign key (group_id) references auth_group (id)
  114. )
  115.  
  116. create table django_admin_log (
  117. /*
  118. 日志表
  119. */
  120. id int(11) not null auto_increment,
  121. action_time datetime(6) not null,
  122. object_id longtext,
  123. object_repr varchar(200) not null,
  124. action_flag smallint(5) unsigned not null,
  125. change_message longtext not null,
  126. content_type_id int(11) DEFAULT NULL,
  127. user_id int(11) not null,
  128.  
  129. primary key (id),
  130. key ix_django_admin_log_content_type_id (content_type_id),
  131. key ix_django_admin_log_user_id (user_id),
  132. constraint fk_django_admin_log_content_type_id foreign key (content_type_id) references django_content_type (id),
  133. constraint fk_django_admin_log_user_id foreign key (user_id) references auth_user (id)
  134. )
  135.  
  136. create table django_session (
  137. /*
  138. 会话表
  139. */
  140. session_key varchar(40) not null,
  141. session_data longtext not null,
  142. expire_date datetime(6) not null,
  143.  
  144. primary key (session_key),
  145. key ix_django_session_expire_date (expire_date)
  146. )

django 用户管理相关的表的更多相关文章

  1. linux 学习7 用户管理相关文件 r

    7.1.用户配置文件 7.2.用户管理相关文件 7.3.用户管理命令 7.4.用户组管理命令 删除用户userdel [root@localhost ~]# userdel [-r] 用户名 //一定 ...

  2. 用户信息文件/etc/passwd,影子文件/etc/shadow,组信息文件/etc/group,组密码文件/etc/gshadow,用户管理相关文件

    /etc/passwd man 5 passwd查看配置文件信息 account:password:UID:GID:GECOS:directory:shell 帐号:密码:用户ID:组ID:一般的信息 ...

  3. mysql命令大全用户管理相关命令

        1.登陆 mysql>mysql -uJDev -p 2.用户管理 mysql>use mysql; 3.查看有哪些登陆用户 mysql> select host,user, ...

  4. centos的用户管理相关命令所在的包

    用户管理命令是指:useradd userdel  groupadd groupdel 这些 这些命令出自一个叫 shadow-utils 的包. 对于配置文件 /etc/shadow ,则来自一个叫 ...

  5. django 用户管理系列:1 user

    :first-child{margin-top:0!important}.markdown-body>:last-child{margin-bottom:0!important}.markdow ...

  6. 6月21日 Django ORM那些相关操作(表关联、聚合查询和分组查询)

    一.ForeignKey操作 正向查找 对象查找(跨表) 语法: 对象.关联字段.字段   示例: book_obj = models.Book.objects.first() # 第一本书对象 pr ...

  7. linux的用户管理相关配置文件

    Linux的管理命令的本质不过是对配置文件/etc相关文件的修改罢了 

  8. 【Python】解决Django Admin管理界面样式表(CSS Style)丢失问题

    配置Django Admin,关于如何启用请参考Django官方文档<Activate the admin site>.但是我在配置过程中登录http://example.com/admi ...

  9. Linux用户和用户组管理 用户管理相关命令

    用户添加命令 useradd 注意: 新添加的用户如果不设定密码是不能够登录系统的 命令格式: [root@localhost ~]#useradd [选项] 用户名 选项说明: 选项 选项说明 -u ...

随机推荐

  1. Linux安装和设置Samba服务器

    1. 安装 安装前先关闭iptables和SELinux. Centos输入以下命令: yum install samba samba-client Ubuntu输入以下命令: apt-get ins ...

  2. 演示一下:rm -rf /

  3. 《Unix&Linux大学教程》学习笔记一:历史与常识

     “为什么说Unix/Linux是自由的:         因为我们可以自己组装一个操作系统:Unix/Linux内核+其他实用工具+编程工具+GUI         因为我们可以自由地获取开源工作者 ...

  4. static_cast<void>(0)的意义及NDEBUG assert的使用

    查看ace代码时发现如下代码 #define ACE_TEST_ASSERT(X) \ ((X) \ ? static_cast<) \ : ACE_VERSIONED_NAMESPACE_NA ...

  5. 【AIX】用户、组合安全管理

    用户介绍 用户的概述 比如:我们在使用AIX系统的时候,同事需要使用我的计算机,但是我不想让他用我的用户登录,我的用户存在一些特殊信息,只能自己查看,此时就可以建立一个普通用户给他使用即可. 1.单用 ...

  6. 4、redis之使用commons-pool

    增加池的配置文件redis-pool.properties: #最大能够保持idel状态的对象数 redis.pool.maxIdle=200 #当池内没有返回对象时,最大等待时间 redis.poo ...

  7. python 模块之os.path模块

    # -*- coding: cp936 -*- #python 27 #xiaodeng #python 模块之os.path模块 #http://www.cnblogs.com/dkblog/arc ...

  8. 使用CodePush实时更新 React Native 和 Cordova 应用

    近期公司的React native App(云订货)用上CodePush实时更新App技术了.棒棒的 CodePush 是微软开发的.能够实时更新 React Native 和 Cordova 应用. ...

  9. Nginx 日志改成 JSON 格式

    Nginx 日志默认为普通文本的格式,例如,下面是 Nginx 的一行访问日志: 10.88.122.105 - - [02/Dec/2017:09:15:04 +0800] "GET /j ...

  10. Swift3 根据秒数获取视频时长(转换成00:00:00时间格式)以及将时长转换成秒

    直接代码了: /// 秒转换成00:00:00格式 /// /// - Parameter secounds: <#secounds description#> /// - Returns ...