程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Computer graduation design Python+django college student information management system (source code + system + mysql database + Lw document)

編輯:Python

項目介紹

學生信息管理是學生管理不可缺少的部分,它的內容對於班級的教師和學生都非常重要,所以高校學生信息管理系統應該能夠為用戶提供足夠的信息和信息的查詢手段,但長時間以來對於學生信息的收集管理多是人工操作,工作繁瑣,重復,占用了很長時間.

隨著科技的發展,Computer technology is maturing,Computers have spread to all fields of society and play an irreplaceable role.For the convenience of student information management,Use computer to manage student information,It has the incomparable advantages of manual management such as:It can be used multiple times and retrieved quickly with only one collection of information、查找方便、可靠性高、存儲量大、保密性好、Low cost and so on,The development of a student information management system is of very high value.
This system mainly realizes the personal center,學生管理,學籍信息管理,干部信息管理,Disciplinary information management,Bonus type management,Bonus information management,Bonus application management,課程表管理,考勤信息管理,請假信息管理,Campus card information management,校園卡信息,充值信息管理,Self-consumption information management 等功能

開發環境

計算機畢業設計Python+djangoThe college student information management system(源碼+系統+mysql數據庫+Lw文檔)
開發語言:Python
python框架:django
軟件版本:python3.7/python3.8
數據庫:mysql 5.7或更高版本
數據庫工具:Navicat11
開發軟件:PyCharm/vs code
前端框架:vue.js
可開發框架:ssm/Springboot/vue/python/PHP/小程序/安卓均可開發

系統截圖





核心代碼

#coding:utf-8
__author__ = "ila"
from django.http import JsonResponse
from django.apps import apps
from django.db.models.aggregates import Count,Sum
from .models import jiangjinshenqing
from util.codes import *
from util.auth import Auth
import util.message as mes
def jiangjinshenqing_register(request):
if request.method in ["POST", "GET"]:
msg = {
'code': normal_code, "msg": mes.normal_code}
req_dict = request.session.get("req_dict")
error = jiangjinshenqing.createbyreq(jiangjinshenqing, jiangjinshenqing, req_dict)
if error != None:
msg['code'] = crud_error_code
msg['msg'] = error
return JsonResponse(msg)
def jiangjinshenqing_login(request):
if request.method in ["POST", "GET"]:
msg = {
'code': normal_code, "msg": mes.normal_code}
req_dict = request.session.get("req_dict")
datas = jiangjinshenqing.getbyparams(jiangjinshenqing, jiangjinshenqing, req_dict)
if not datas:
msg['code'] = password_error_code
msg['msg'] = mes.password_error_code
return JsonResponse(msg)
req_dict['id'] = datas[0].get('id')
return Auth.authenticate(Auth, jiangjinshenqing, req_dict)
def jiangjinshenqing_logout(request):
if request.method in ["POST", "GET"]:
msg = {

"msg": "登出成功",
"code": 0
}
return JsonResponse(msg)
def jiangjinshenqing_resetPass(request):
''' '''
if request.method in ["POST", "GET"]:
msg = {
"code": normal_code, "msg": mes.normal_code}
req_dict = request.session.get("req_dict")
error = jiangjinshenqing.updatebyparams(jiangjinshenqing,jiangjinshenqing, req_dict)
if error != None:
msg['code'] = crud_error_code
msg['msg'] = error
return JsonResponse(msg)
def jiangjinshenqing_session(request):
''' '''
if request.method in ["POST", "GET"]:
msg = {
"code": normal_code,"msg": mes.normal_code, "data": {
}}
req_dict={
"id":request.session.get('params').get("id")}
msg['data'] = jiangjinshenqing.getbyparams(jiangjinshenqing, jiangjinshenqing, req_dict)[0]
return JsonResponse(msg)
def jiangjinshenqing_page(request):
''' '''
if request.method in ["POST", "GET"]:
msg = {
"code": normal_code, "msg": mes.normal_code, "data":{
"currPage":1,"totalPage":1,"total":1,"pageSize":10,"list":[]}}
req_dict = request.session.get("req_dict")
#獲取全部列名
columns= jiangjinshenqing.getallcolumn( jiangjinshenqing, jiangjinshenqing)
#當前登錄用戶所在表
tablename = request.session.get("tablename")
#當列屬性authTable有值(某個用戶表)[該列的列名必須和該用戶表的登陸字段名一致],則對應的表有個隱藏屬性authTable為”是”,那麼該用戶查看該表信息時,只能查看自己的
try:
__authTables__=jiangjinshenqing.__authTables__
except:
__authTables__=None
if __authTables__!=None and __authTables__!={
}:
for authColumn,authTable in __authTables__.items():
if authTable==tablename:
params = request.session.get("params")
req_dict[authColumn]=params.get(authColumn)
break
#authColumn=list(__authTables__.keys())[0]
#authTable=__authTables__.get(authColumn)
# if authTable==tablename:
#params = request.session.get("params")
#req_dict[authColumn]=params.get(authColumn)
'''__authSeparate__此屬性為真,params添加userid,後台只查詢個人數據'''
try:
__authSeparate__=jiangjinshenqing.__authSeparate__
except:
__authSeparate__=None
if __authSeparate__=="是":
tablename=request.session.get("tablename")
if tablename!="users" and 'userid' in columns:
try:
req_dict['userid']=request.session.get("params").get("id")
except:
pass
#當項目屬性hasMessage為”是”,生成系統自動生成留言板的表messages,同時該表的表屬性hasMessage也被設置為”是”,字段包括userid(用戶id),username(用戶名),content(留言內容),reply(回復)
#接口page需要區分權限,普通用戶查看自己的留言和回復記錄,管理員查看所有的留言和回復記錄
try:
__hasMessage__=jiangjinshenqing.__hasMessage__
except:
__hasMessage__=None
if __hasMessage__=="是":
tablename=request.session.get("tablename")
if tablename!="users":
req_dict["userid"]=request.session.get("params").get("id")
# 判斷當前表的表屬性isAdmin,為真則是管理員表
# 當表屬性isAdmin=”是”,刷出來的用戶表也是管理員,即page和list可以查看所有人的考試記錄(同時應用於其他表)
__isAdmin__ = None
allModels = apps.get_app_config('main').get_models()
for m in allModels:
if m.__tablename__==tablename:
try:
__isAdmin__ = m.__isAdmin__
except:
__isAdmin__ = None
break
# 當前表也是有管理員權限的表
if __isAdmin__ == "是" and req_dict.get("userid"):
del req_dict["userid"]
else:
#非管理員權限的表,判斷當前表字段名是否有userid
if tablename!="users" and "userid" in jiangjinshenqing.getallcolumn(jiangjinshenqing,jiangjinshenqing):
req_dict["userid"] = request.session.get("params").get("id")
msg['data']['list'], msg['data']['currPage'], msg['data']['totalPage'], msg['data']['total'], \
msg['data']['pageSize'] =jiangjinshenqing.page(jiangjinshenqing, jiangjinshenqing, req_dict)
return JsonResponse(msg)
def jiangjinshenqing_autoSort(request):
''' .智能推薦功能(表屬性:[intelRecom(是/否)],新增clicktime[The front end does not display this field]字段(調用info/detailupdate the interface),按clicktime排序查詢) List of main information(such as a product list,新聞列表)中使用,Shows the most recently clicked or newly added5Just a record '''
if request.method in ["POST", "GET"]:
msg = {
"code": normal_code, "msg": mes.normal_code, "data":{
"currPage":1,"totalPage":1,"total":1,"pageSize":10,"list":[]}}
req_dict = request.session.get("req_dict")
req_dict['sort']='clicktime'
req_dict['order']='desc'
msg['data']['list'], msg['data']['currPage'], msg['data']['totalPage'], msg['data']['total'], \
msg['data']['pageSize'] = jiangjinshenqing.page(jiangjinshenqing,jiangjinshenqing, req_dict)
return JsonResponse(msg)
def jiangjinshenqing_list(request):
''' 前台分頁 '''
if request.method in ["POST", "GET"]:
msg = {
"code": normal_code, "msg": mes.normal_code, "data":{
"currPage":1,"totalPage":1,"total":1,"pageSize":10,"list":[]}}
req_dict = request.session.get("req_dict")
#獲取全部列名
columns= jiangjinshenqing.getallcolumn( jiangjinshenqing, jiangjinshenqing)
#表屬性[foreEndList]前台list:and background defaultlistList pages are similar,Just put it in the foreground,否:means that this page does not exist,是:Indicates that this page exists(No login required to view),To get on before:Indicates that this page exists and needs to be logged in to view it
try:
__foreEndList__=jiangjinshenqing.__foreEndList__
except:
__foreEndList__=None
if __foreEndList__=="是":
tablename=request.session.get("tablename")
if tablename!="users" and 'userid' in columns:
try:
req_dict['userid']=request.session.get("params").get("id")
except:
pass
tablename = request.session.get("tablename")
if tablename == "users" and req_dict.get("userid") != None:#判斷是否存在userid列名
del req_dict["userid"]
else:
__isAdmin__ = None
allModels = apps.get_app_config('main').get_models()
for m in allModels:
if m.__tablename__==tablename:
try:
__isAdmin__ = m.__isAdmin__
except:
__isAdmin__ = None
break
if __isAdmin__ == "是" and req_dict.get("userid"):
del req_dict["userid"]
else:
#非管理員權限的表,判斷當前表字段名是否有userid
if "userid" in columns:
try:
# This interface can be accessed anonymously,所以tryDetermine whether to be anonymous
req_dict['userid']=request.session.get("params").get("id")
except:
pass
msg['data']['list'], msg['data']['currPage'], msg['data']['totalPage'], msg['data']['total'], \
msg['data']['pageSize'] = jiangjinshenqing.page(jiangjinshenqing, jiangjinshenqing, req_dict)
return JsonResponse(msg)
def jiangjinshenqing_save(request):
''' 後台新增 '''
if request.method in ["POST", "GET"]:
msg = {
"code": normal_code, "msg": mes.normal_code, "data": {
}}
req_dict = request.session.get("req_dict")
error= jiangjinshenqing.createbyreq(jiangjinshenqing,jiangjinshenqing, req_dict)
if error!=None:
msg['code'] = crud_error_code
msg['msg'] = error
return JsonResponse(msg)
def jiangjinshenqing_add(request):
''' 前台新增 '''
if request.method in ["POST", "GET"]:
msg = {
"code": normal_code, "msg": mes.normal_code, "data": {
}}
req_dict = request.session.get("req_dict")
#獲取全部列名
columns= jiangjinshenqing.getallcolumn( jiangjinshenqing, jiangjinshenqing)
try:
__authSeparate__=jiangjinshenqing.__authSeparate__
except:
__authSeparate__=None
if __authSeparate__=="是":
tablename=request.session.get("tablename")
if tablename!="users" and 'userid' in columns:
try:
req_dict['userid']=request.session.get("params").get("id")
except:
pass
try:
__foreEndListAuth__=jiangjinshenqing.__foreEndListAuth__
except:
__foreEndListAuth__=None
if __foreEndListAuth__ and __foreEndListAuth__!="否":
tablename=request.session.get("tablename")
if tablename!="users":
req_dict['userid']=request.session.get("params").get("id")
error= jiangjinshenqing.createbyreq(jiangjinshenqing,jiangjinshenqing, req_dict)
if error!=None:
msg['code'] = crud_error_code
msg['msg'] = error
return JsonResponse(msg)
def jiangjinshenqing_thumbsup(request,id_):
''' 點贊:表屬性thumbsUp[是/否],Brush table addedthumbsupnum贊和crazilynumDislike field, '''
if request.method in ["POST", "GET"]:
msg = {
"code": normal_code, "msg": mes.normal_code, "data": {
}}
req_dict = request.session.get("req_dict")
id_=int(id_)
type_=int(req_dict.get("type",0))
rets=jiangjinshenqing.getbyid(jiangjinshenqing,jiangjinshenqing,id_)
update_dict={

"id":id_,
}
if type_==1:#贊
update_dict["thumbsupnum"]=int(rets[0].get('thumbsupnum'))+1
elif type_==2:#踩
update_dict["crazilynum"]=int(rets[0].get('crazilynum'))+1
error = jiangjinshenqing.updatebyparams(jiangjinshenqing,jiangjinshenqing, update_dict)
if error!=None:
msg['code'] = crud_error_code
msg['msg'] = error
return JsonResponse(msg)
def jiangjinshenqing_info(request,id_):
''' '''
if request.method in ["POST", "GET"]:
msg = {
"code": normal_code, "msg": mes.normal_code, "data": {
}}
data = jiangjinshenqing.getbyid(jiangjinshenqing,jiangjinshenqing, int(id_))
if len(data)>0:
msg['data']=data[0]
#Browse clicks
try:
__browseClick__= jiangjinshenqing.__browseClick__
except:
__browseClick__=None
if __browseClick__=="是" and "clicknum" in jiangjinshenqing.getallcolumn(jiangjinshenqing,jiangjinshenqing):
try:
clicknum=int(data[0].get("clicknum",0))+1
except:
clicknum=0+1
click_dict={
"id":int(id_),"clicknum":clicknum}
ret=jiangjinshenqing.updatebyparams(jiangjinshenqing,jiangjinshenqing,click_dict)
if ret!=None:
msg['code'] = crud_error_code
msg['msg'] = ret
return JsonResponse(msg)
def jiangjinshenqing_detail(request,id_):
''' '''
if request.method in ["POST", "GET"]:
msg = {
"code": normal_code, "msg": mes.normal_code, "data": {
}}
data =jiangjinshenqing.getbyid(jiangjinshenqing,jiangjinshenqing, int(id_))
if len(data)>0:
msg['data']=data[0]
#Browse clicks
try:
__browseClick__= jiangjinshenqing.__browseClick__
except:
__browseClick__=None
if __browseClick__=="是" and "clicknum" in jiangjinshenqing.getallcolumn(jiangjinshenqing,jiangjinshenqing):
try:
clicknum=int(data[0].get("clicknum",0))+1
except:
clicknum=0+1
click_dict={
"id":int(id_),"clicknum":clicknum}
#click_dict={"id":int(id_),"clicknum":str(int(data[0].get("clicknum",0))+1)}
ret=jiangjinshenqing.updatebyparams(jiangjinshenqing,jiangjinshenqing,click_dict)
if ret!=None:
msg['code'] = crud_error_code
msg['msg'] = ret
return JsonResponse(msg)
def jiangjinshenqing_update(request):
''' '''
if request.method in ["POST", "GET"]:
msg = {
"code": normal_code, "msg": mes.normal_code, "data": {
}}
req_dict = request.session.get("req_dict")
if req_dict.get("mima") and req_dict.get("password"):
if "mima" not in jiangjinshenqing.getallcolumn(jiangjinshenqing,jiangjinshenqing) :
del req_dict["mima"]
if "password" not in jiangjinshenqing.getallcolumn(jiangjinshenqing,jiangjinshenqing) :
del req_dict["password"]
try:
del req_dict["clicknum"]
except:
pass
error = jiangjinshenqing.updatebyparams(jiangjinshenqing, jiangjinshenqing, req_dict)
if error!=None:
msg['code'] = crud_error_code
msg['msg'] = error
return JsonResponse(msg)
def jiangjinshenqing_delete(request):
''' 批量刪除 '''
if request.method in ["POST", "GET"]:
msg = {
"code": normal_code, "msg": mes.normal_code, "data": {
}}
req_dict = request.session.get("req_dict")
error=jiangjinshenqing.deletes(jiangjinshenqing,
jiangjinshenqing,
req_dict.get("ids")
)
if error!=None:
msg['code'] = crud_error_code
msg['msg'] = error
return JsonResponse(msg)
def jiangjinshenqing_vote(request,id_):
''' Browse clicks(表屬性[browseClick:是/否],點擊字段(clicknum),調用info/detailWhen the interface is used, the backend is automatic+1)、投票功能(表屬性[vote:是/否],voting field(votenum),調用vote接口後端votenum+1) Count clicks on products or news;Provides a polling function for news '''
if request.method in ["POST", "GET"]:
msg = {
"code": normal_code, "msg": mes.normal_code}
data= jiangjinshenqing.getbyid(jiangjinshenqing, jiangjinshenqing, int(id_))
for i in data:
votenum=i.get('votenum')
if votenum!=None:
params={
"id":int(id_),"votenum":votenum+1}
error=jiangjinshenqing.updatebyparams(jiangjinshenqing,jiangjinshenqing,params)
if error!=None:
msg['code'] = crud_error_code
msg['msg'] = error
return JsonResponse(msg)

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved