团队作业(五):冲刺总结2
团队作业(五):冲刺总结2
项目名:电子公文传输系统
成员分工:熊悠越(前端开发)、罗杰逊+谷丰宇(后端开发)、陈夏林(数据库管理)、董准(系统测试与维护)
日期:2023.12.09
今日任务完成情况
前端
前端部分代码
<!-- adduser.html -->
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>新增用户</title>
<link rel="stylesheet" href="{% static 'css/adduserpage.css' %}">
<!-- 此处包含您的样式表或其他资源 -->
</head>
<body>
<h1>新增用户</h1>
<form method="post" action="{% url 'create_user' %}">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">确认</button>
<a href="{% url 'index' %}">取消</a>
</form>
<script src="{% static 'js/verify_up.js' %}"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.querySelector('form').addEventListener('submit', function(event) {
event.preventDefault(); // 阻止表单默认提交行为
// 提交表单后,等待 3 秒后跳转到 index 页面
setTimeout(function() {
document.querySelector('form').submit(); // 提交表单
}, 3000); // 等待 3 秒
});
});
</script>
</body>
</html>
{% load static %}
<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
<meta charset="UTF-8">
<title>修改用户信息</title>
<link rel="stylesheet" href="{% static 'css/change_userinfo.css' %}">
<!-- 此处包含您的样式表或其他资源 -->
</head>
<body>
<h1>修改用户信息</h1>
<form method="post" action="{% url 'change_userinfo' user_profile.id %}">
{% csrf_token %}
<label for="id">学号:</label>
<input type="text" id="id" name="id" value="{{ user_profile.id }}" disabled><br><br>
<label for="username">用户名:</label>
<input type="text" id="username" name="username_up" value="{{ user_profile.username_up }}"><br><br>
<label for="email">邮箱:</label>
<input type="email" id="email" name="email" value="{{ user_profile.email }}"><br><br>
<label for="password">密码:</label>
<input type="password" id="password" name="password_up" value="{{ user_profile.password_up }}"><br><br>
<!-- 如果还有其他字段需要修改,继续添加 -->
<button type="submit">提交</button>
<a href="{% url 'index' %}">取消</a>
</form>
<script src="{% static 'js/verify_up.js' %}"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.querySelector('form').addEventListener('submit', function(event) {
event.preventDefault(); // 阻止表单默认提交行为
// 提交表单后,等待 3 秒后跳转到 index 页面
setTimeout(function() {
document.querySelector('form').submit(); // 提交表单
}, 3000); // 等待 3 秒
});
});
</script>
</body>
</html>
登录
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
import django
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'P1.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
后端
"""
Django settings for P1 project.
Generated by 'django-admin startproject' using Django 4.2.7.
For more information on this file, see
https://docs.djangoproject.com/en/4.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.2/ref/settings/
"""
import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-q)pli&shq$lai=@kr+o85)!b(-dhk%#c*z&76fr3a^d)^^n^8q'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = [
'192.168.135.70', # 添加你的局域网地址
'127.0.0.1',
'localhost'
]
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'web',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'P1.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'web/views'], # 指向包含模板的目录
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'P1.wsgi.application'
# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3', # 指定SQLite数据库文件的路径
}
}
#DATABASES = {
## 'default': {
# 'ENGINE': 'django.db.backends.mysql',
#'NAME':'testdb',
#'USER': 'root',
#'PASSWORD': '1234',
#'HOST': '127.0.0.1',
#'PORT': 3306,
#}
#}
# Password validation
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/4.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.2/howto/static-files/
STATIC_URL = '/static/'
# Default primary key field type
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'web/media'
以上代码均已托管至公文传输系统实现代码/冲刺
冲刺第二天
第二天 | 负责人 | 工作量 |
---|---|---|
完成数据库与对象的ORM | 陈夏林 | 2 |
实现模板应用实例化 | 陈夏林 | 2 |
精简优化数据库结构 | 陈夏林 | 1 |
设置加密和文件处理功能 | 谷丰宇、罗杰逊 | 3 |
文件上传下载模块 | 谷丰宇、罗杰逊 | 1 |
适配增加的功能 | 谷丰宇、罗杰逊 | 1 |
前端网页 | 董准、熊悠越 | 1 |
设计重定向url方向 | 董准、熊悠越 | 2 |
完成用户数据的相关内容 | 董准、熊悠越 | 1 |
明日任务安排 | 熊悠越 | 1 |
明日任务安排
第三天 | 工作量 |
---|---|
调试数据库 | 2 |
完善接口 | 3 |
数据库初始化设置 | 4 |
完善文件上传下载模块 | 2 |
基于角色的权限控制设计 | 2 |
适配增加的功能 | 1 |
根据后端接口完善前端界面 | 3 |
继续完善用户数据的相关内容 | 2 |
明日任务安排 | 1 |