├── db.sqlite3 ├── app ├── __init__.py ├── migrations │ └── __init__.py ├── models.py ├── admin.py ├── tests.py ├── apps.py └── views.py ├── .gitignore ├── student_info ├── __init__.py ├── asgi.py ├── wsgi.py ├── urls.py └── settings.py ├── static ├── images │ └── loading.gif └── js │ └── jquery-3.5.1.min.js ├── templates ├── add_class.html ├── edit_class.html ├── add_student.html ├── add_teacher.html ├── edit_teacher.html ├── edit_student.html ├── login.html ├── layout.html ├── teacher.html ├── class.html └── student.html ├── manage.py ├── README.md ├── utils └── sqlhelper.py └── test.sql /db.sqlite3: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | -------------------------------------------------------------------------------- /app/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /student_info/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /app/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /app/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /app/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AppConfig(AppConfig): 5 | name = 'app' 6 | -------------------------------------------------------------------------------- /static/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThanlonSmith/stu-django/HEAD/static/images/loading.gif -------------------------------------------------------------------------------- /student_info/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for student_info project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'student_info.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /student_info/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for student_info project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'student_info.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /templates/add_class.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | {% block css %}{% endblock %} 3 | {% block content %} 4 |
8 || ID | 53 |教师姓名 | 54 |任教班级 | 55 |操作 | 56 |
|---|---|---|---|
| {{ row.tid }} | 60 |{{ row.name }} | 61 |62 | {% for item in row.titles %} 63 | {{ item }} 64 | {% endfor %} 65 | | 66 |67 | 编辑 68 | 删除 69 | | 70 |
| id | 83 |班级名称 | 84 |操作 | 85 |
|---|---|---|
| {{ row.id }} | 89 |{{ row.title }} | 90 |91 | 编辑(1) 93 | 编辑(2) 95 | 删除(1) 96 | 删除(2) 97 | | 98 |
| ID | 42 |学生姓名 | 43 |学生班级 | 44 |操作 | 45 ||
|---|---|---|---|---|
| {{ row.id }} | 49 |{{ row.name }} | 50 |{{ row.title }} | 51 | {#{{ row.class_id }} | #} 52 |53 | 编辑(1) 54 | 编辑(2) 55 | 删除(1) 56 | 删除(2) 57 | | 58 |