Graduation design document content management system based on Python+Bootstrap+Django+MySQL

Table of contents

Abstract I
Abstract II
Chapter 1 Introduction 1
1.1 Subject background and significance 1
1.2 Research status at home and abroad 1
1.3 System design goals 1
1.4 Structure of this paper 1
Chapter 2 Feasibility analysis 2
2.1 Technical feasibility analysis 2
2.2 Operational feasibility 2
2.3 Economy Feasibility 2
Chapter 3 Requirements Analysis 3
3.1 Overall System Requirements Analysis 3
3.2 System Detailed Requirements Analysis 3
3.3 System Database Requirements Analysis 3
3.3.1 Data Flow Diagram 3
3.3.2 Data Dictionary Description 9
Chapter 4 System Development Tools and Use Technology introduction 17
4.1 System development tools 17
4.1.1 PyCharm 17
4.1.2 MySQL 17
4.1.3 NaviCat Premium 17
4.2 System usage technology 17
4.2.1 Python programming language 17
4.2.2 Django framework based on MVT architecture 18
4.2.3 FastDFS Distributed Storage 18
4.2.4 Nginx 19
Chapter 5 System Design 20
5.1 System Software and Hardware Environment 20
5.1.1 System Hardware Environment 20
5.1.2 System Software Environment 20
5.2 System overall design 20
5.2.1 System overview and functions 20
5.3 System detailed design 21
5.3.1 Registration management 21
5.3.2 Login management 21
5.3.3 Topic management 22
5.3.4 Topic selection management 23
5.3.5 Topic opening management 23
5.4 System database design 23
5.4.1 Conceptual design 24
5.4.2 Logical design 24
5.4.3 Physical design 25
Chapter 6 System realization 28
6.1 Graduate role realization 28
6.1.1 Topic selection realization 28
6.1.2 Thesis opening realization 28
6.1.4 Reply Realization 28
6.2 Graduation Advisor Function Realization 29
6.3 Teaching Secretary Function Realization 29
Chapter 7 System Test 30
Conclusion 31 References
31 Acknowledgments
31
Chapter 3 Requirement Analysis
3.1 Overall System Requirement Analysis
This system is aimed at teaching staff and fresh students , divided into teachers, teaching secretaries and students, students and teachers perform business in the foreground, and teaching secretaries deploy business in the background. Students can log in, select topics, check personal information, submit documents and evaluate, etc. Teachers can perform operations such as setting questions and uploading documents, and teaching secretaries can manage and deploy relevant data information.

3.2 System detailed requirement analysis
Main functions of students:
(1) Log in: log in according to user name and password.
(2) Topic selection: View all topics and select graduation design topics.
(3) Topic opening: Download the topic-related document template and upload the topic opening report.
(4) Upload the interim report: upload the relevant documents of the interim report.
(5) Defense: defense application, upload relevant documents.
(6) Feedback: Evaluation of the instructor.

Main functions of teachers:
(1) Topic management: add, delete, check and modify topics.
(2) Topic status management: Modify the topic confirmation status.
(3) Interim report management: download relevant documents of interim report
(4) Defense: upload relevant documents and record the defense process.
(5) Achievement management: Grading the graduates and calculating the total score of the defense.
(6) Feedback: evaluate the graduates.

The main functions of the teaching secretary:
(1) Log in: log in according to the user name and password.
(2) Management of user information, user rights, questions, and question status.

from django.http import HttpResponse
from django.shortcuts import render, redirect, reverse, get_object_or_404
from django.views import View
from apps.user.models import User
from django.contrib.auth import authenticate, login, logout
from rolepermissions.roles import assign_role


# /register/
class RegisterView(View):
    @staticmethod
    def get(request):
        # 显示注册页面
        return render(request, 'register.html')

    @staticmethod
    def post(request):
        name = request.POST.get('registerName', None)
        username = request.POST.get('registerUsername', None)
        password = request.POST.get('registerPassword', None)
        school = request.POST.get('registerSchool', None)
        department = request.POST.get('registerDepartment', None)
        email = request.POST.get('registerEmail', None)

        if not all([username, password]):
            print("数据不完整")

        user = User.objects.create_user(
            name=name,
            username=username,
            password=password,
            school=school,
            department=department,
            email=email
        )
        user.save()

        # 默认角色为学生
        assign_role(user, 'student')
        return redirect(reverse('login'))


# /login/
class LoginView(View):
    @staticmethod
    def get(request):
        return render(request, 'login.html')

    @staticmethod
    def post(request):
        username = request.POST.get('userName', None)
        password = request.POST.get('passWord', None)
        print(username)
        print(password)

        user = authenticate(username=username, password=password)
        print(user)

        if user is not None:
            login(request, user)
            next_url = request.GET.get('next', reverse('topic:all_topic'))
            response = redirect(next_url)
            return response
        else:
            return render(request, 'login.html')


class LogoutView(View):
    '''退出登录'''

    def get(self, request):
        '''退出登录'''
        # 清除用户session信息
        logout(request)
        # 跳转到首页
        return redirect(reverse('login'))


def user_center(request):
    user = User.objects.get(id=request.user.id)
    context = {
        "name": user.name,
        "school": user.school,
        "department": user.department,
        "memo": user.memo,
        "email": user.email
    }
    return render(request, "user/user_center.html", context=context)


def edit_user_profile(request):
    user = User.objects.get(id=request.user.id)

    if request.method == "GET":
        department = user.department
        email = user.email
        memo = user.memo
        context = {
            "department": department,
            "email": email,
            "memo": memo,
        }
        return render(request, "user/edit_user_profile.html", context=context)
    else:
        print("!!!")
        form = request.POST
        print(form)
        user.department = form['department']
        user.email = form['email']
        user.memo = form['memo']
        user.save()
        return render(request, "user/edit_user_profile.html")


def change_pwd(request):
    user = get_object_or_404(User, id=request.user.id)
    if request.method == "GET":
        return render(request, "user/change_pwd.html")
    else:
        form = request.POST
        print(form)
        pwd = form['registerPassword']
        pwd_confirm = form['registerPasswords']
        if pwd == pwd_confirm:
            print(pwd)
            user.set_password(pwd)
            user.save()
            return redirect(reverse("login"))
        else:
            return redirect(reverse("topic:all_topic"))


def page_not_found(request, exception):
    return render(request, '404.html', status=404)


def page_error(request):
    return render(request, '500.html', status=500)

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/sheziqiong/article/details/130718239