当前位置:   article > 正文

【python毕业设计】Django框架实现学生信息管理系统_基于django的毕业设计

基于django的毕业设计

Django框架实现学生信息管理系统

演示视频:Django学生信息管理系统_腾讯视频

演示界面内容如下

总体概括

注册流程

首先进行输入用户名(邮箱)、密码以及验证码,输入完之后点击注册按钮。如果输入的不正确,提示错误信息。

如果一切信息填写正确无误,调用STMP模块发送激活邮件,用户必须要点击接收到邮箱链接,进行邮件激活后才方可登陆。

即使注册成功,没有激活的用户也不能登陆,用户以get的方式直接重定向到注册页面。

注册登录:

用户能在系统中进行登陆注册和忘记密码进行找回的功能。

个人中心:修改头像,修改密码,修改邮箱,可以看到我的信息。

日志记录:

记录后台人员的操作,方便发现BUG和查看各项调用进行时间。

导航栏:学生信息中有基本信息、年级及成绩信息的模块,能够排序筛选等功能。

多选操作:

可以选择多条记录进行删除操作,还可以在课程列表页可以对不同课程进行排序。

数据页码:

可以设置各项数据在每一页中显示的数量多少,进行翻页功能。

模块列表页:

能够有过滤器功能,在范围内进行查看数据。还能将数据导出为csvxmljson等数据格式。

model.py

  1. from django.db import models
  2. # Create your models here.
  3. class Grades(models.Model):
  4. gname = models.CharField(max_length=20)
  5. gdate = models.DateTimeField()
  6. gteacher = models.CharField(max_length=20)
  7. ggirlnum = models.IntegerField()
  8. gboynum = models.IntegerField()
  9. isDelete = models.BooleanField(default=False)
  10. def __str__(self):
  11. return self.gname
  12. class Students(models.Model):
  13. sname = models.CharField(max_length=20)
  14. sgender = models.BooleanField(default=True)
  15. sminzu = models.CharField(max_length=20)
  16. sbir = models.IntegerField()
  17. scontend = models.CharField(max_length=20)
  18. shome = models.CharField(max_length=20)
  19. sidcard = models.CharField(max_length=20)
  20. sschnum = models.IntegerField()
  21. stel = models.CharField(max_length=20)
  22. steacher = models.CharField(max_length=20)
  23. isDelete = models.BooleanField(default=False)
  24. # 关联外键
  25. sgrade = models.ForeignKey("Grades", on_delete=models.CASCADE)
  26. def __str__(self):
  27. return self.sname
  28. # class Score(models.Model):
  29. # math = models.IntegerField()
  30. # 关联外键
  31. sgrade = models.ForeignKey("Grades", on_delete=models.CASCADE)
  32. from django.db import models
  33. from django.contrib.auth.models import Group
  34. from django.conf import settings
  35. from django.utils.encoding import python_2_unicode_compatible
  36. AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
  37. SERVER_STATUS = (
  38. (0, u"Normal"),
  39. (1, u"Down"),
  40. (2, u"No Connect"),
  41. (3, u"Error"),
  42. )
  43. SERVICE_TYPES = (
  44. ('moniter', u"Moniter"),
  45. ('lvs', u"LVS"),
  46. ('db', u"Database"),
  47. ('analysis', u"Analysis"),
  48. ('admin', u"Admin"),
  49. ('storge', u"Storge"),
  50. ('web', u"WEB"),
  51. ('email', u"Email"),
  52. ('mix', u"Mix"),
  53. )
  54. @python_2_unicode_compatible
  55. class AccessRecord(models.Model):
  56. date = models.DateField()
  57. user_count = models.IntegerField()
  58. view_count = models.IntegerField()
  59. class Meta:
  60. verbose_name = u"Access Record"
  61. verbose_name_plural = verbose_name
  62. # def __str__(self):
  63. # return "%s Access Record" % self.date.strftime('%Y-%m-%d')
  64. from django.db import models
  65. from django.contrib.auth.models import Group
  66. from django.conf import settings
  67. from django.utils.encoding import python_2_unicode_compatible
  68. AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
  69. SERVER_STATUS = (
  70. (0, u"Normal"),
  71. (1, u"Down"),
  72. (2, u"No Connect"),
  73. (3, u"Error"),
  74. )
  75. SERVICE_TYPES = (
  76. ('moniter', u"Moniter"),
  77. ('lvs', u"LVS"),
  78. ('db', u"Database"),
  79. ('analysis', u"Analysis"),
  80. ('admin', u"Admin"),
  81. ('storge', u"Storge"),
  82. ('web', u"WEB"),
  83. ('email', u"Email"),
  84. ('mix', u"Mix"),
  85. )
  86. @python_2_unicode_compatible
  87. class AccessRecord(models.Model):
  88. date = models.DateField()
  89. user_count = models.IntegerField()
  90. view_count = models.IntegerField()
  91. class Meta:
  92. verbose_name = u"Access Record"
  93. verbose_name_plural = verbose_name
  94. # def __str__(self):
  95. # return "%s Access Record" % self.date.strftime('%Y-%m-%d')

admin.py

  1. from django.contrib import admin
  2. # Register your models here.
  3. from .models import Grades,Students
  4. class StudentsInfo(admin.TabularInline):#StackeInLine显示不同 增加页面
  5. model = Students
  6. extra = 2
  7. class GradesAdmin(admin.ModelAdmin):
  8. inlines = [StudentsInfo]
  9. #列表页属性
  10. list_display = ['id','gname','gdate','ggirlnum','gboynum','gteacher','isDelete',]
  11. list_filter = ['gteacher']
  12. search_fields = ['gname']
  13. list_per_page = 5
  14. #
  15. # #添加修改页属性
  16. # fields = ['ganame','gdate','ggirlnum','isDelete','gboynum']
  17. # fieldsets = [('num',{"fields":['ggirlnum','gboynum']}),('base',{"fields":['gname','gdate','isDelete','home','shome','sbir','sidcard','sschnum','stel']})]
  18. @admin.register(Students)
  19. class StudentAdmin(admin.ModelAdmin):
  20. def gender(self):
  21. if self.sgender:
  22. return "女"
  23. else:
  24. return "男"
  25. #设置页面名称
  26. gender.short_description = "性别"
  27. list_display = ['pk','sname',gender,'scontend','sgrade','isDelete','shome','sbir','sidcard','sschnum','stel']
  28. #每页显示人数
  29. list_per_page = 10
  30. #按照班级筛选
  31. list_filter = ['sgrade']
  32. #查找
  33. search_fields = ['sname']
  34. #执行动作的位置
  35. actions_on_bottom = True
  36. actions_on_top = False
  37. #注册
  38. # admin.site.register(Students,StudentAdmin)
  39. admin.site.register(Grades,GradesAdmin)

    

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/154038
推荐阅读
相关标签
  

闽ICP备14008679号