完成一个基本的弹幕功能
This commit is contained in:
44
.gitignore
vendored
Normal file
44
.gitignore
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
# Django项目常见的.gitignore配置
|
||||
|
||||
# 虚拟环境
|
||||
venv/
|
||||
env/
|
||||
ENV/
|
||||
.venv/
|
||||
|
||||
# Python编译文件
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# Django相关
|
||||
local_settings.py
|
||||
*.sqlite3
|
||||
*.db
|
||||
*.log
|
||||
media/
|
||||
staticfiles/
|
||||
.env
|
||||
|
||||
# 测试相关
|
||||
pytest_cache/
|
||||
.tox/
|
||||
.coverage
|
||||
htmlcov/
|
||||
|
||||
# IDE相关
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
.DS_Store
|
||||
|
||||
# 脚本文件(根据项目情况可调整)
|
||||
*.sh
|
||||
*.bat
|
||||
|
||||
# 其他
|
||||
.cache/
|
||||
*.egg-info/
|
||||
MANIFEST
|
||||
225
.trae/documents/Django弹幕活动应用实现计划.md
Normal file
225
.trae/documents/Django弹幕活动应用实现计划.md
Normal file
@@ -0,0 +1,225 @@
|
||||
# Django弹幕活动应用实现计划
|
||||
|
||||
## 项目结构
|
||||
|
||||
```
|
||||
danmu_activity/
|
||||
├── danmu_activity/ # 项目配置目录
|
||||
│ ├── __init__.py
|
||||
│ ├── settings.py
|
||||
│ ├── urls.py
|
||||
│ └── wsgi.py
|
||||
├── activity/ # 主应用
|
||||
│ ├── __init__.py
|
||||
│ ├── admin.py
|
||||
│ ├── apps.py
|
||||
│ ├── models.py # 数据库模型
|
||||
│ ├── views.py # 视图函数
|
||||
│ ├── urls.py # 应用路由
|
||||
│ ├── utils.py # 工具函数(如随机祝福语)
|
||||
│ ├── static/ # 静态文件
|
||||
│ │ ├── css/
|
||||
│ │ ├── js/
|
||||
│ │ └── media/ # 上传的媒体文件
|
||||
│ └── templates/ # 模板文件
|
||||
│ ├── activity/
|
||||
│ └── admin/
|
||||
├── manage.py
|
||||
└── requirements.txt
|
||||
```
|
||||
|
||||
activity/forms.py 定义表单类(提交弹幕表单、活动设置表单、图片上传表单),替代模板原生表单,提升安全性和可维护性
|
||||
|
||||
<br />
|
||||
|
||||
templates/base.html 基础模板(统一页面布局、引入 Bootstrap/jQuery 公共资源,其他模板继承使用)
|
||||
templates/404.html 自定义 404 错误页面(提升用户体验)
|
||||
templates/500.html 自定义 500 错误页面(方便线上问题排查)
|
||||
|
||||
## 数据库设计
|
||||
|
||||
### 1. 活动设置模型(ActivitySetting)
|
||||
|
||||
* 背景图片(ImageField)
|
||||
|
||||
* 背景视频(FileField)
|
||||
|
||||
* 二维码图片(ImageField)
|
||||
|
||||
* 二维码位置(CharField:top-left, top-right, bottom-left, bottom-right, center)
|
||||
|
||||
* 弹幕字体颜色(CharField:十六进制颜色码)
|
||||
|
||||
* 弹幕背景颜色(CharField:十六进制颜色码)
|
||||
|
||||
* 全局背景颜色(CharField:十六进制颜色码)
|
||||
|
||||
### 2. 祝福语模型(Blessing)
|
||||
|
||||
* 内容(TextField)
|
||||
|
||||
### 3. 弹幕消息模型(Danmu)
|
||||
|
||||
* 姓名(CharField)
|
||||
|
||||
* 祝福语(TextField)
|
||||
|
||||
* 图片(ImageField, 可选)
|
||||
|
||||
* 审核状态(BooleanField:默认False,未审核)
|
||||
|
||||
* 创建时间(DateTimeField)
|
||||
|
||||
## 视图设计
|
||||
|
||||
### 1. 主页面视图(index)
|
||||
|
||||
* 显示全屏背景(图片/视频)
|
||||
|
||||
* 显示二维码
|
||||
|
||||
* 实时显示已审核通过的弹幕
|
||||
|
||||
### 2. 扫码提交视图(submit)
|
||||
|
||||
* 显示表单:姓名输入框、祝福语输入框(带5条随机推荐)、图片上传
|
||||
|
||||
* 提交后保存到数据库,等待审核
|
||||
|
||||
### 3. 管理员审核视图(admin\_review)
|
||||
|
||||
* 显示所有未审核的弹幕
|
||||
|
||||
* 支持通过/不通过审核
|
||||
|
||||
### 4. 设置视图(setting)
|
||||
|
||||
* 管理员可设置背景图片/视频、二维码图片、位置、弹幕颜色等
|
||||
|
||||
### 5. API视图
|
||||
|
||||
* 获取实时弹幕列表(JSON格式)
|
||||
|
||||
## 模板设计
|
||||
|
||||
### 1. 主页面模板(index.html)
|
||||
|
||||
* 全屏布局
|
||||
|
||||
* 背景图片/视频自适应
|
||||
|
||||
* 二维码定位显示
|
||||
|
||||
* 弹幕滚动效果
|
||||
|
||||
### 2. 提交表单模板(submit.html)
|
||||
|
||||
* 响应式设计,适配手机
|
||||
|
||||
* 表单验证
|
||||
|
||||
* 随机祝福语推荐
|
||||
|
||||
* 图片上传预览
|
||||
|
||||
### 3. 审核页面模板(admin\_review\.html)
|
||||
|
||||
* 表格展示待审核弹幕
|
||||
|
||||
* 操作按钮(通过/不通过)
|
||||
|
||||
* 批量审核功能
|
||||
|
||||
* 筛选功能
|
||||
|
||||
* 时间
|
||||
|
||||
### 4. 设置页面模板(setting.html)
|
||||
|
||||
* 表单设计,支持文件上传
|
||||
|
||||
* 实时预览效果
|
||||
|
||||
## 静态资源
|
||||
|
||||
### 1. CSS
|
||||
|
||||
* 全屏布局样式
|
||||
|
||||
* 弹幕滚动动画
|
||||
|
||||
* 响应式设计
|
||||
|
||||
### 2. JavaScript
|
||||
|
||||
* 实时获取弹幕(Ajax轮询)
|
||||
|
||||
* 弹幕动画效果,从右向左滑动,多行显示,
|
||||
|
||||
* 考虑到有些弹幕包含图片,计算图片的高度和宽度,不遮挡其它文字弹幕
|
||||
|
||||
* 表单验证和提交
|
||||
|
||||
### 3. 媒体文件
|
||||
|
||||
* 默认背景图片
|
||||
|
||||
* 默认二维码图片
|
||||
|
||||
* 上传的用户图片存储目录
|
||||
|
||||
## 工具函数
|
||||
|
||||
### 1. 随机祝福语生成
|
||||
|
||||
* 从数据库中随机获取5条祝福语
|
||||
|
||||
* 提供几百条预设祝福语
|
||||
|
||||
### 2. 媒体文件处理
|
||||
|
||||
* 图片压缩
|
||||
|
||||
* 视频格式验证
|
||||
|
||||
## 实现步骤
|
||||
|
||||
1. 初始化Django项目
|
||||
2. 创建应用和基本模型
|
||||
3. 实现管理员后台配置
|
||||
4. 添加预设祝福语
|
||||
5. 实现扫码提交功能
|
||||
6. 实现主页面弹幕显示
|
||||
7. 实现管理员审核功能
|
||||
8. 实现设置页面
|
||||
9. 添加CSS样式和JavaScript交互
|
||||
10. 测试和优化
|
||||
|
||||
## 技术栈
|
||||
|
||||
* Django 5.2.9
|
||||
|
||||
* Bootstrap 5(前端框架)
|
||||
|
||||
* jQuery(简化DOM操作)
|
||||
|
||||
* SQLite(开发环境数据库)
|
||||
|
||||
## 安全考虑
|
||||
|
||||
* 图片上传验证和限制
|
||||
|
||||
* 管理员页面权限控制
|
||||
|
||||
* 防止XSS攻击
|
||||
|
||||
* CSRF保护
|
||||
|
||||
## 部署考虑
|
||||
|
||||
* 静态文件和媒体文件的部署
|
||||
|
||||
* 数据库迁移
|
||||
|
||||
* 性能优化(如弹幕缓存)
|
||||
|
||||
0
activity/__init__.py
Normal file
0
activity/__init__.py
Normal file
7
activity/admin.py
Normal file
7
activity/admin.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from django.contrib import admin
|
||||
from .models import ActivitySetting, Blessing, Danmu
|
||||
|
||||
# Register your models here.
|
||||
admin.site.register(ActivitySetting)
|
||||
admin.site.register(Blessing)
|
||||
admin.site.register(Danmu)
|
||||
6
activity/apps.py
Normal file
6
activity/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class ActivityConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'activity'
|
||||
32
activity/forms.py
Normal file
32
activity/forms.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from django import forms
|
||||
from .models import ActivitySetting, Danmu
|
||||
|
||||
class DanmuForm(forms.ModelForm):
|
||||
"""弹幕提交表单"""
|
||||
class Meta:
|
||||
model = Danmu
|
||||
fields = ['name', 'content', 'image']
|
||||
widgets = {
|
||||
'name': forms.TextInput(attrs={'class': 'form-control', 'placeholder': '请输入您的姓名'}),
|
||||
'content': forms.Textarea(attrs={'class': 'form-control', 'placeholder': '请输入祝福语', 'rows': 3}),
|
||||
'image': forms.FileInput(attrs={'class': 'form-control'}),
|
||||
}
|
||||
|
||||
class ActivitySettingForm(forms.ModelForm):
|
||||
"""活动设置表单"""
|
||||
class Meta:
|
||||
model = ActivitySetting
|
||||
fields = ['background_image', 'background_video', 'qr_code_image', 'qr_code_position', 'qr_code_margin_top', 'qr_code_margin_left', 'qr_code_margin_bottom', 'qr_code_margin_right', 'danmu_font_color', 'danmu_bg_color', 'global_bg_color']
|
||||
widgets = {
|
||||
'qr_code_position': forms.Select(attrs={'class': 'form-control'}),
|
||||
'qr_code_margin_top': forms.NumberInput(attrs={'class': 'form-control', 'placeholder': '距离上边距(px)'}),
|
||||
'qr_code_margin_left': forms.NumberInput(attrs={'class': 'form-control', 'placeholder': '距离左边距(px)'}),
|
||||
'qr_code_margin_bottom': forms.NumberInput(attrs={'class': 'form-control', 'placeholder': '距离下边距(px)'}),
|
||||
'qr_code_margin_right': forms.NumberInput(attrs={'class': 'form-control', 'placeholder': '距离右边距(px)'}),
|
||||
'danmu_font_color': forms.TextInput(attrs={'class': 'form-control', 'type': 'color'}),
|
||||
'danmu_bg_color': forms.TextInput(attrs={'class': 'form-control', 'type': 'color'}),
|
||||
'global_bg_color': forms.TextInput(attrs={'class': 'form-control', 'type': 'color'}),
|
||||
'background_image': forms.FileInput(attrs={'class': 'form-control'}),
|
||||
'background_video': forms.FileInput(attrs={'class': 'form-control'}),
|
||||
'qr_code_image': forms.FileInput(attrs={'class': 'form-control'}),
|
||||
}
|
||||
58
activity/migrations/0001_initial.py
Normal file
58
activity/migrations/0001_initial.py
Normal file
@@ -0,0 +1,58 @@
|
||||
# Generated by Django 5.0.6 on 2025-12-30 03:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ActivitySetting',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('background_image', models.ImageField(blank=True, null=True, upload_to='activity_media/', verbose_name='背景图片')),
|
||||
('background_video', models.FileField(blank=True, null=True, upload_to='activity_media/', verbose_name='背景视频')),
|
||||
('qr_code_image', models.ImageField(blank=True, null=True, upload_to='activity_media/', verbose_name='二维码图片')),
|
||||
('qr_code_position', models.CharField(choices=[('top-left', '左上角'), ('top-right', '右上角'), ('bottom-left', '左下角'), ('bottom-right', '右下角'), ('center', '居中')], default='bottom-right', max_length=20, verbose_name='二维码位置')),
|
||||
('danmu_font_color', models.CharField(default='#FFFFFF', max_length=7, verbose_name='弹幕字体颜色')),
|
||||
('danmu_bg_color', models.CharField(default='#000000', max_length=7, verbose_name='弹幕背景颜色')),
|
||||
('global_bg_color', models.CharField(default='#F0F0F0', max_length=7, verbose_name='全局背景颜色')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '活动设置',
|
||||
'verbose_name_plural': '活动设置',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Blessing',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('content', models.TextField(verbose_name='祝福语内容')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '祝福语',
|
||||
'verbose_name_plural': '祝福语',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Danmu',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=50, verbose_name='姓名')),
|
||||
('content', models.TextField(blank=True, null=True, verbose_name='祝福语')),
|
||||
('image', models.ImageField(blank=True, null=True, upload_to='danmu_media/', verbose_name='图片')),
|
||||
('is_approved', models.BooleanField(default=False, verbose_name='审核状态')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '弹幕消息',
|
||||
'verbose_name_plural': '弹幕消息',
|
||||
'ordering': ['-created_at'],
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,33 @@
|
||||
# Generated by Django 5.0.6 on 2025-12-30 05:33
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('activity', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='activitysetting',
|
||||
name='qr_code_margin_bottom',
|
||||
field=models.IntegerField(default=20, verbose_name='距离下边距(px)'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='activitysetting',
|
||||
name='qr_code_margin_left',
|
||||
field=models.IntegerField(default=20, verbose_name='距离左边距(px)'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='activitysetting',
|
||||
name='qr_code_margin_right',
|
||||
field=models.IntegerField(default=20, verbose_name='距离右边距(px)'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='activitysetting',
|
||||
name='qr_code_margin_top',
|
||||
field=models.IntegerField(default=20, verbose_name='距离上边距(px)'),
|
||||
),
|
||||
]
|
||||
0
activity/migrations/__init__.py
Normal file
0
activity/migrations/__init__.py
Normal file
59
activity/models.py
Normal file
59
activity/models.py
Normal file
@@ -0,0 +1,59 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
|
||||
class ActivitySetting(models.Model):
|
||||
"""活动设置模型"""
|
||||
BACKGROUND_POSITION_CHOICES = (
|
||||
('top-left', '左上角'),
|
||||
('top-right', '右上角'),
|
||||
('bottom-left', '左下角'),
|
||||
('bottom-right', '右下角'),
|
||||
('center', '居中'),
|
||||
)
|
||||
|
||||
background_image = models.ImageField(upload_to='activity_media/', verbose_name='背景图片', blank=True, null=True)
|
||||
background_video = models.FileField(upload_to='activity_media/', verbose_name='背景视频', blank=True, null=True)
|
||||
qr_code_image = models.ImageField(upload_to='activity_media/', verbose_name='二维码图片', blank=True, null=True)
|
||||
qr_code_position = models.CharField(max_length=20, choices=BACKGROUND_POSITION_CHOICES, default='bottom-right', verbose_name='二维码位置')
|
||||
qr_code_margin_top = models.IntegerField(default=20, verbose_name='距离上边距(px)')
|
||||
qr_code_margin_left = models.IntegerField(default=20, verbose_name='距离左边距(px)')
|
||||
qr_code_margin_bottom = models.IntegerField(default=20, verbose_name='距离下边距(px)')
|
||||
qr_code_margin_right = models.IntegerField(default=20, verbose_name='距离右边距(px)')
|
||||
danmu_font_color = models.CharField(max_length=7, default='#FFFFFF', verbose_name='弹幕字体颜色')
|
||||
danmu_bg_color = models.CharField(max_length=7, default='#000000', verbose_name='弹幕背景颜色')
|
||||
global_bg_color = models.CharField(max_length=7, default='#F0F0F0', verbose_name='全局背景颜色')
|
||||
|
||||
class Meta:
|
||||
verbose_name = '活动设置'
|
||||
verbose_name_plural = '活动设置'
|
||||
|
||||
def __str__(self):
|
||||
return '活动设置'
|
||||
|
||||
class Blessing(models.Model):
|
||||
"""祝福语模型"""
|
||||
content = models.TextField(verbose_name='祝福语内容')
|
||||
|
||||
class Meta:
|
||||
verbose_name = '祝福语'
|
||||
verbose_name_plural = '祝福语'
|
||||
|
||||
def __str__(self):
|
||||
return self.content[:20]
|
||||
|
||||
class Danmu(models.Model):
|
||||
"""弹幕消息模型"""
|
||||
name = models.CharField(max_length=50, verbose_name='姓名')
|
||||
content = models.TextField(verbose_name='祝福语', blank=True, null=True)
|
||||
image = models.ImageField(upload_to='danmu_media/', verbose_name='图片', blank=True, null=True)
|
||||
is_approved = models.BooleanField(default=False, verbose_name='审核状态')
|
||||
created_at = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
|
||||
|
||||
class Meta:
|
||||
verbose_name = '弹幕消息'
|
||||
verbose_name_plural = '弹幕消息'
|
||||
ordering = ['-created_at']
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.name}: {self.content[:20]}'
|
||||
111
activity/templates/activity/admin_review.html
Normal file
111
activity/templates/activity/admin_review.html
Normal file
@@ -0,0 +1,111 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block css %}
|
||||
<style>
|
||||
body {
|
||||
background-color: #f8f9fa;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1000px;
|
||||
margin: 50px auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-bottom: 30px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.danmu-table {
|
||||
background-color: white;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.table th, .table td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.danmu-content {
|
||||
max-width: 400px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.danmu-image {
|
||||
max-width: 100px;
|
||||
max-height: 100px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding: 50px 0;
|
||||
color: #6c757d;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h1>弹幕审核</h1>
|
||||
|
||||
{% if danmus %}
|
||||
<div class="danmu-table">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>姓名</th>
|
||||
<th>内容</th>
|
||||
<th>图片</th>
|
||||
<th>创建时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for danmu in danmus %}
|
||||
<tr>
|
||||
<td>{{ danmu.name }}</td>
|
||||
<td class="danmu-content">{{ danmu.content }}</td>
|
||||
<td>
|
||||
{% if danmu.image %}
|
||||
<img src="{{ danmu.image.url }}" alt="图片" class="danmu-image">
|
||||
{% else %}
|
||||
-无-
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ danmu.created_at|date:"Y-m-d H:i:s" }}</td>
|
||||
<td>
|
||||
<div class="action-buttons">
|
||||
<form method="post" style="margin: 0;">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="danmu_id" value="{{ danmu.id }}">
|
||||
<input type="hidden" name="action" value="approve">
|
||||
<button type="submit" class="btn btn-success btn-sm">通过</button>
|
||||
</form>
|
||||
<form method="post" style="margin: 0;">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="danmu_id" value="{{ danmu.id }}">
|
||||
<input type="hidden" name="action" value="reject">
|
||||
<button type="submit" class="btn btn-danger btn-sm">不通过</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<h3>暂无待审核的弹幕</h3>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
279
activity/templates/activity/index.html
Normal file
279
activity/templates/activity/index.html
Normal file
@@ -0,0 +1,279 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block css %}
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
background-color: {{ setting.global_bg_color }};
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
#background-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
#background-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
#background-video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
#qr-code {
|
||||
position: fixed;
|
||||
{% if setting.qr_code_position == 'top-left' %}
|
||||
top: {{ setting.qr_code_margin_top }}px;
|
||||
left: {{ setting.qr_code_margin_left }}px;
|
||||
{% elif setting.qr_code_position == 'top-right' %}
|
||||
top: {{ setting.qr_code_margin_top }}px;
|
||||
right: {{ setting.qr_code_margin_right }}px;
|
||||
{% elif setting.qr_code_position == 'bottom-left' %}
|
||||
bottom: {{ setting.qr_code_margin_bottom }}px;
|
||||
left: {{ setting.qr_code_margin_left }}px;
|
||||
{% elif setting.qr_code_position == 'bottom-right' %}
|
||||
bottom: {{ setting.qr_code_margin_bottom }}px;
|
||||
right: {{ setting.qr_code_margin_right }}px;
|
||||
{% elif setting.qr_code_position == 'center' %}
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
{% endif %}
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
#qr-code img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 2px solid white;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#danmu-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
z-index: 50;
|
||||
}
|
||||
|
||||
.danmu-item {
|
||||
position: absolute;
|
||||
white-space: nowrap;
|
||||
padding: 12px 18px;
|
||||
border-radius: 25px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: {{ setting.danmu_font_color }};
|
||||
background-color: rgba({{ setting.danmu_bg_color|slice:'1:3'|add:','|add:setting.danmu_bg_color|slice:'3:5'|add:','|add:setting.danmu_bg_color|slice:'5:7'|add:','|add:'0.8' }});
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
||||
animation: danmu-scroll 8s linear infinite;
|
||||
backdrop-filter: blur(2px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.danmu-item img {
|
||||
max-height: 100px;
|
||||
max-width: 200px;
|
||||
vertical-align: middle;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
@keyframes danmu-scroll {
|
||||
from { transform: translateX(100vw); }
|
||||
to { transform: translateX(-100%); }
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
#qr-code {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.danmu-item {
|
||||
font-size: 16px;
|
||||
padding: 10px 15px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="background-container">
|
||||
{% if setting.background_video %}
|
||||
<video id="background-video" autoplay loop muted playsinline>
|
||||
<source src="{{ setting.background_video.url }}" type="video/mp4">
|
||||
</video>
|
||||
{% elif setting.background_image %}
|
||||
<img id="background-image" src="{{ setting.background_image.url }}" alt="背景图片">
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div id="qr-code">
|
||||
{% if setting.qr_code_image %}
|
||||
<img src="{{ setting.qr_code_image.url }}" alt="二维码">
|
||||
{% else %}
|
||||
<!-- 默认二维码 -->
|
||||
<img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data={{ request.build_absolute_uri }}{% url 'submit' %}" alt="默认二维码">
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div id="danmu-container">
|
||||
<!-- 初始弹幕 -->
|
||||
{% for danmu in danmus %}
|
||||
<div class="danmu-item">
|
||||
{{ danmu.name }}: {{ danmu.content }}
|
||||
{% if danmu.image %}
|
||||
<img src="{{ danmu.image.url }}" alt="图片">
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// 获取弹幕容器
|
||||
const danmuContainer = $('#danmu-container');
|
||||
const containerHeight = danmuContainer.height();
|
||||
const containerWidth = danmuContainer.width();
|
||||
|
||||
// 弹幕高度(包含padding和margin)
|
||||
const DANMU_HEIGHT = 60;
|
||||
|
||||
// 上次获取弹幕的时间
|
||||
let lastTime = new Date().toISOString();
|
||||
|
||||
// 获取所有当前弹幕的位置信息
|
||||
function getCurrentDanmuPositions() {
|
||||
const positions = [];
|
||||
const danmus = danmuContainer.find('.danmu-item');
|
||||
danmus.each(function() {
|
||||
const $danmu = $(this);
|
||||
const top = parseInt($danmu.css('top')) || 0;
|
||||
positions.push({
|
||||
top: top,
|
||||
bottom: top + DANMU_HEIGHT
|
||||
});
|
||||
});
|
||||
return positions;
|
||||
}
|
||||
|
||||
// 检查位置是否与现有弹幕重叠
|
||||
function isPositionOverlapping(newTop) {
|
||||
const positions = getCurrentDanmuPositions();
|
||||
const newBottom = newTop + DANMU_HEIGHT;
|
||||
|
||||
for (const pos of positions) {
|
||||
// 检查是否有重叠
|
||||
if (!(newBottom <= pos.top || newTop >= pos.bottom)) {
|
||||
return true; // 重叠
|
||||
}
|
||||
}
|
||||
return false; // 不重叠
|
||||
}
|
||||
|
||||
// 生成随机且不重叠的位置
|
||||
function getRandomNonOverlappingTop() {
|
||||
let attempts = 0;
|
||||
const maxAttempts = 20;
|
||||
let newTop;
|
||||
|
||||
do {
|
||||
// 生成随机位置,考虑边距和弹幕高度
|
||||
newTop = Math.floor(Math.random() * (containerHeight - DANMU_HEIGHT - 20)) + 10;
|
||||
attempts++;
|
||||
} while (isPositionOverlapping(newTop) && attempts < maxAttempts);
|
||||
|
||||
// 如果尝试多次仍失败,返回一个安全位置
|
||||
if (attempts >= maxAttempts) {
|
||||
newTop = Math.floor(Math.random() * (containerHeight - DANMU_HEIGHT - 20)) + 10;
|
||||
}
|
||||
|
||||
return newTop;
|
||||
}
|
||||
|
||||
// 添加新弹幕
|
||||
function addDanmu(danmu) {
|
||||
// 获取随机且不重叠的位置
|
||||
const topPosition = getRandomNonOverlappingTop();
|
||||
|
||||
const danmuItem = $('<div>', {
|
||||
class: 'danmu-item',
|
||||
style: `top: ${topPosition}px;`,
|
||||
text: `${danmu.name}: ${danmu.content}`
|
||||
});
|
||||
|
||||
if (danmu.image) {
|
||||
const img = $('<img>', {
|
||||
src: danmu.image,
|
||||
alt: '图片',
|
||||
onload: function() {
|
||||
// 图片加载完成后重新计算宽度
|
||||
danmuItem.css('animation', 'danmu-scroll 8s linear infinite');
|
||||
}
|
||||
});
|
||||
danmuItem.append(' ').append(img);
|
||||
}
|
||||
|
||||
danmuContainer.append(danmuItem);
|
||||
|
||||
// 8秒后移除弹幕
|
||||
setTimeout(() => {
|
||||
danmuItem.remove();
|
||||
}, 8000);
|
||||
}
|
||||
|
||||
// 定时获取新弹幕
|
||||
setInterval(() => {
|
||||
$.ajax({
|
||||
url: '{% url 'api_danmu' %}',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
const newDanmus = data.danmus.filter(danmu => new Date(danmu.created_at) > new Date(lastTime));
|
||||
|
||||
if (newDanmus.length > 0) {
|
||||
newDanmus.forEach(danmu => {
|
||||
addDanmu(danmu);
|
||||
});
|
||||
|
||||
// 更新最后时间
|
||||
lastTime = new Date().toISOString();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 2000); // 每2秒获取一次
|
||||
|
||||
// 初始弹幕位置处理
|
||||
function initDanmuPositions() {
|
||||
const danmus = danmuContainer.find('.danmu-item');
|
||||
danmus.each(function() {
|
||||
const topPosition = getRandomNonOverlappingTop();
|
||||
$(this).css('top', topPosition + 'px');
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化弹幕位置
|
||||
initDanmuPositions();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
193
activity/templates/activity/setting.html
Normal file
193
activity/templates/activity/setting.html
Normal file
@@ -0,0 +1,193 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block css %}
|
||||
<style>
|
||||
body {
|
||||
background-color: #f8f9fa;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 50px auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-bottom: 30px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.setting-form {
|
||||
background-color: white;
|
||||
padding: 30px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.preview-section {
|
||||
background-color: #e9ecef;
|
||||
padding: 20px;
|
||||
border-radius: 5px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.preview-title {
|
||||
margin-bottom: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.color-preview {
|
||||
display: inline-block;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
margin-left: 10px;
|
||||
vertical-align: middle;
|
||||
border: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
padding: 12px 30px;
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h1>活动设置</h1>
|
||||
|
||||
<div class="setting-form">
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.background_image.label_tag }}
|
||||
{{ form.background_image }}
|
||||
{% if form.background_image.errors %}
|
||||
<div class="text-danger">{{ form.background_image.errors }}</div>
|
||||
{% endif %}
|
||||
{% if setting.background_image %}
|
||||
<div class="mt-2">
|
||||
<small class="text-muted">当前背景图片:</small>
|
||||
<img src="{{ setting.background_image.url }}" alt="当前背景图片" style="max-width: 200px; max-height: 100px; border-radius: 5px;">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.background_video.label_tag }}
|
||||
{{ form.background_video }}
|
||||
{% if form.background_video.errors %}
|
||||
<div class="text-danger">{{ form.background_video.errors }}</div>
|
||||
{% endif %}
|
||||
{% if setting.background_video %}
|
||||
<div class="mt-2">
|
||||
<small class="text-muted">当前背景视频:{{ setting.background_video.name }}</small>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.qr_code_image.label_tag }}
|
||||
{{ form.qr_code_image }}
|
||||
{% if form.qr_code_image.errors %}
|
||||
<div class="text-danger">{{ form.qr_code_image.errors }}</div>
|
||||
{% endif %}
|
||||
{% if setting.qr_code_image %}
|
||||
<div class="mt-2">
|
||||
<small class="text-muted">当前二维码:</small>
|
||||
<img src="{{ setting.qr_code_image.url }}" alt="当前二维码" style="max-width: 100px; max-height: 100px; border-radius: 5px;">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.qr_code_position.label_tag }}
|
||||
{{ form.qr_code_position }}
|
||||
{% if form.qr_code_position.errors %}
|
||||
<div class="text-danger">{{ form.qr_code_position.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_danmu_font_color">
|
||||
弹幕字体颜色
|
||||
<span class="color-preview" id="font-color-preview" style="background-color: {{ setting.danmu_font_color }};"></span>
|
||||
</label>
|
||||
{{ form.danmu_font_color }}
|
||||
{% if form.danmu_font_color.errors %}
|
||||
<div class="text-danger">{{ form.danmu_font_color.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_danmu_bg_color">
|
||||
弹幕背景颜色
|
||||
<span class="color-preview" id="bg-color-preview" style="background-color: {{ setting.danmu_bg_color }};"></span>
|
||||
</label>
|
||||
{{ form.danmu_bg_color }}
|
||||
{% if form.danmu_bg_color.errors %}
|
||||
<div class="text-danger">{{ form.danmu_bg_color.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_global_bg_color">
|
||||
全局背景颜色
|
||||
<span class="color-preview" id="global-color-preview" style="background-color: {{ setting.global_bg_color }};"></span>
|
||||
</label>
|
||||
{{ form.global_bg_color }}
|
||||
{% if form.global_bg_color.errors %}
|
||||
<div class="text-danger">{{ form.global_bg_color.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">保存设置</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="preview-section">
|
||||
<div class="preview-title">预览效果:</div>
|
||||
<div style="width: 100%; height: 200px; background-color: {{ setting.global_bg_color }}; border-radius: 5px; position: relative; overflow: hidden;">
|
||||
{% if setting.background_image %}
|
||||
<img src="{{ setting.background_image.url }}" alt="背景预览" style="width: 100%; height: 100%; object-fit: cover;">
|
||||
{% endif %}
|
||||
<div style="position: absolute; {{ setting.qr_code_position|safe }}: 10px; width: 80px; height: 80px;">
|
||||
{% if setting.qr_code_image %}
|
||||
<img src="{{ setting.qr_code_image.url }}" alt="二维码预览" style="width: 100%; height: 100%; border: 2px solid white; border-radius: 5px;">
|
||||
{% else %}
|
||||
<!-- 默认二维码预览 -->
|
||||
<img src="https://api.qrserver.com/v1/create-qr-code/?size=80x80&data={{ request.build_absolute_uri }}{% url 'submit' %}" alt="二维码预览" style="width: 100%; height: 100%; border: 2px solid white; border-radius: 5px;">
|
||||
{% endif %}
|
||||
</div>
|
||||
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 10px 20px; border-radius: 20px; font-size: 16px; font-weight: bold; color: {{ setting.danmu_font_color }}; background-color: {{ setting.danmu_bg_color }}; opacity: 0.8;">
|
||||
示例弹幕
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// 实时更新颜色预览
|
||||
$('#id_danmu_font_color').on('input', function() {
|
||||
$('#font-color-preview').css('background-color', $(this).val());
|
||||
});
|
||||
|
||||
$('#id_danmu_bg_color').on('input', function() {
|
||||
$('#bg-color-preview').css('background-color', $(this).val());
|
||||
});
|
||||
|
||||
$('#id_global_bg_color').on('input', function() {
|
||||
$('#global-color-preview').css('background-color', $(this).val());
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
123
activity/templates/activity/submit.html
Normal file
123
activity/templates/activity/submit.html
Normal file
@@ -0,0 +1,123 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block css %}
|
||||
<style>
|
||||
body {
|
||||
background-color: #f8f9fa;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 500px;
|
||||
margin: 50px auto;
|
||||
padding: 30px;
|
||||
background-color: white;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
margin-bottom: 30px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.blessing-list {
|
||||
background-color: #e9ecef;
|
||||
padding: 15px;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.blessing-item {
|
||||
margin-bottom: 10px;
|
||||
cursor: pointer;
|
||||
padding: 5px;
|
||||
border-radius: 3px;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
.blessing-item:hover {
|
||||
background-color: #dee2e6;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h1>发送祝福</h1>
|
||||
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.name.label_tag }}
|
||||
{{ form.name }}
|
||||
{% if form.name.errors %}
|
||||
<div class="text-danger">{{ form.name.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.content.label_tag }}
|
||||
{{ form.content }}
|
||||
{% if form.content.errors %}
|
||||
<div class="text-danger">{{ form.content.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="blessing-list">
|
||||
<h5>推荐祝福语:</h5>
|
||||
<div class="row">
|
||||
{% for blessing in random_blessings %}
|
||||
<div class="col-12 blessing-item" onclick="fillBlessing('{{ blessing.content|escapejs }}')">
|
||||
{{ blessing.content }}
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-12 text-center text-muted">暂无推荐祝福语</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.image.label_tag }}
|
||||
{{ form.image }}
|
||||
{% if form.image.errors %}
|
||||
<div class="text-danger">{{ form.image.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">发送</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script>
|
||||
function fillBlessing(content) {
|
||||
document.getElementById('id_content').value = content;
|
||||
}
|
||||
|
||||
// 表单验证
|
||||
$(document).ready(function() {
|
||||
$('form').submit(function() {
|
||||
const name = $('#id_name').val();
|
||||
if (!name.trim()) {
|
||||
alert('请输入您的姓名');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
22
activity/templates/base.html
Normal file
22
activity/templates/base.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>弹幕活动</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
|
||||
<!-- 自定义CSS -->
|
||||
{% block css %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- 自定义JS -->
|
||||
{% block js %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
3
activity/tests.py
Normal file
3
activity/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
10
activity/urls.py
Normal file
10
activity/urls.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from django.urls import path
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.index, name='index'),
|
||||
path('submit/', views.submit, name='submit'),
|
||||
path('admin-review/', views.admin_review, name='admin_review'),
|
||||
path('setting/', views.setting, name='setting'),
|
||||
path('api/danmu/', views.api_danmu, name='api_danmu'),
|
||||
]
|
||||
780
activity/utils.py
Normal file
780
activity/utils.py
Normal file
@@ -0,0 +1,780 @@
|
||||
from .models import Blessing
|
||||
|
||||
def add_default_blessings():
|
||||
"""添加预设的祝福语"""
|
||||
default_blessings = [
|
||||
"身体健康,万事如意!",
|
||||
"事业有成,步步高升!",
|
||||
"家庭幸福,和睦美满!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,招财进宝!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福星高照!",
|
||||
"平安顺遂,一生无忧!",
|
||||
"开心快乐,笑口常开!",
|
||||
"好运连连,喜事不断!",
|
||||
"青春永驻,活力四射!",
|
||||
"一帆风顺,马到成功!",
|
||||
"花开富贵,金玉满堂!",
|
||||
"福禄双全,寿比南山!",
|
||||
"喜气洋洋,红红火火!",
|
||||
"年年有余,岁岁平安!",
|
||||
"吉祥如意,万事亨通!",
|
||||
"笑口常开,好运自然来!",
|
||||
"身体健康,吃嘛嘛香!",
|
||||
"工作顺利,事业有成!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途无量!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!"
|
||||
]
|
||||
|
||||
# 批量创建祝福语,如果已存在则跳过
|
||||
for blessing_content in default_blessings:
|
||||
Blessing.objects.get_or_create(content=blessing_content)
|
||||
|
||||
return f"已添加或更新 {len(default_blessings)} 条祝福语"
|
||||
98
activity/views.py
Normal file
98
activity/views.py
Normal file
@@ -0,0 +1,98 @@
|
||||
from django.shortcuts import render, redirect
|
||||
from django.http import JsonResponse
|
||||
from .models import ActivitySetting, Blessing, Danmu
|
||||
from .forms import DanmuForm, ActivitySettingForm
|
||||
|
||||
# Create your views here.
|
||||
def index(request):
|
||||
"""主页面视图"""
|
||||
setting = ActivitySetting.objects.first() or ActivitySetting.objects.create()
|
||||
danmus = Danmu.objects.filter(is_approved=True).order_by('-created_at')
|
||||
|
||||
context = {
|
||||
'setting': setting,
|
||||
'danmus': danmus,
|
||||
}
|
||||
|
||||
return render(request, 'activity/index.html', context)
|
||||
|
||||
def submit(request):
|
||||
"""扫码提交视图"""
|
||||
random_blessings = Blessing.objects.order_by('?')[:5]
|
||||
|
||||
if request.method == 'POST':
|
||||
form = DanmuForm(request.POST, request.FILES)
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
return redirect('index')
|
||||
else:
|
||||
form = DanmuForm()
|
||||
|
||||
context = {
|
||||
'form': form,
|
||||
'random_blessings': random_blessings,
|
||||
}
|
||||
|
||||
return render(request, 'activity/submit.html', context)
|
||||
|
||||
def admin_review(request):
|
||||
"""管理员审核视图"""
|
||||
danmus = Danmu.objects.filter(is_approved=False).order_by('-created_at')
|
||||
|
||||
if request.method == 'POST':
|
||||
danmu_id = request.POST.get('danmu_id')
|
||||
action = request.POST.get('action')
|
||||
|
||||
if danmu_id and action:
|
||||
try:
|
||||
danmu = Danmu.objects.get(id=danmu_id)
|
||||
if action == 'approve':
|
||||
danmu.is_approved = True
|
||||
danmu.save()
|
||||
elif action == 'reject':
|
||||
danmu.delete()
|
||||
except Danmu.DoesNotExist:
|
||||
pass
|
||||
|
||||
return redirect('admin_review')
|
||||
|
||||
context = {
|
||||
'danmus': danmus,
|
||||
}
|
||||
|
||||
return render(request, 'activity/admin_review.html', context)
|
||||
|
||||
def setting(request):
|
||||
"""设置视图"""
|
||||
setting = ActivitySetting.objects.first() or ActivitySetting.objects.create()
|
||||
|
||||
if request.method == 'POST':
|
||||
form = ActivitySettingForm(request.POST, request.FILES, instance=setting)
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
return redirect('index')
|
||||
else:
|
||||
form = ActivitySettingForm(instance=setting)
|
||||
|
||||
context = {
|
||||
'form': form,
|
||||
'setting': setting,
|
||||
}
|
||||
|
||||
return render(request, 'activity/setting.html', context)
|
||||
|
||||
def api_danmu(request):
|
||||
"""获取实时弹幕API"""
|
||||
danmus = Danmu.objects.filter(is_approved=True).order_by('-created_at')[:50]
|
||||
danmu_list = [
|
||||
{
|
||||
'id': danmu.id,
|
||||
'name': danmu.name,
|
||||
'content': danmu.content,
|
||||
'image': danmu.image.url if danmu.image else None,
|
||||
'created_at': danmu.created_at.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
}
|
||||
for danmu in danmus
|
||||
]
|
||||
|
||||
return JsonResponse({'danmus': danmu_list})
|
||||
26
add_default_blessings.py
Normal file
26
add_default_blessings.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python
|
||||
"""添加预设祝福语脚本"""
|
||||
import os
|
||||
import sys
|
||||
|
||||
# 添加项目根目录到Python路径
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
# 导入Django设置
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'danmu_activity.settings')
|
||||
|
||||
# 初始化Django
|
||||
import django
|
||||
django.setup()
|
||||
|
||||
# 导入添加祝福语的函数
|
||||
from activity.utils import add_default_blessings
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
print("开始添加预设祝福语...")
|
||||
add_default_blessings()
|
||||
print("预设祝福语添加完成!")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
49
add_test_danmus.py
Normal file
49
add_test_danmus.py
Normal file
@@ -0,0 +1,49 @@
|
||||
import os
|
||||
import sys
|
||||
import django
|
||||
|
||||
# 设置Django环境
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'danmu_activity.settings')
|
||||
django.setup()
|
||||
|
||||
from activity.models import Danmu
|
||||
|
||||
def add_test_danmus():
|
||||
"""添加测试弹幕数据"""
|
||||
test_danmus = [
|
||||
{
|
||||
'name': '测试用户1',
|
||||
'content': '这是第一条测试弹幕!',
|
||||
'is_approved': True
|
||||
},
|
||||
{
|
||||
'name': '测试用户2',
|
||||
'content': '这是第二条测试弹幕,祝活动圆满成功!',
|
||||
'is_approved': True
|
||||
},
|
||||
{
|
||||
'name': '测试用户3',
|
||||
'content': '这是第三条测试弹幕,大家玩得开心!',
|
||||
'is_approved': True
|
||||
},
|
||||
{
|
||||
'name': '测试用户4',
|
||||
'content': '这是第四条测试弹幕,感谢组织者!',
|
||||
'is_approved': True
|
||||
},
|
||||
{
|
||||
'name': '测试用户5',
|
||||
'content': '这是第五条测试弹幕,祝大家身体健康!',
|
||||
'is_approved': True
|
||||
}
|
||||
]
|
||||
|
||||
print("开始添加测试弹幕...")
|
||||
for danmu_data in test_danmus:
|
||||
Danmu.objects.create(**danmu_data)
|
||||
|
||||
print(f"成功添加 {len(test_danmus)} 条测试弹幕!")
|
||||
|
||||
if __name__ == '__main__':
|
||||
add_test_danmus()
|
||||
21
create_setting.py
Normal file
21
create_setting.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import os
|
||||
import sys
|
||||
import django
|
||||
|
||||
# 设置Django环境
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'danmu_activity.settings')
|
||||
django.setup()
|
||||
|
||||
from activity.models import ActivitySetting
|
||||
|
||||
def create_activity_setting():
|
||||
"""创建活动设置(如果不存在)"""
|
||||
if not ActivitySetting.objects.exists():
|
||||
setting = ActivitySetting.objects.create()
|
||||
print("活动设置已创建")
|
||||
else:
|
||||
print("活动设置已存在")
|
||||
|
||||
if __name__ == '__main__':
|
||||
create_activity_setting()
|
||||
0
danmu_activity/__init__.py
Normal file
0
danmu_activity/__init__.py
Normal file
16
danmu_activity/asgi.py
Normal file
16
danmu_activity/asgi.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
ASGI config for danmu_activity project.
|
||||
|
||||
It exposes the ASGI callable as a module-level variable named ``application``.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.asgi import get_asgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'danmu_activity.settings')
|
||||
|
||||
application = get_asgi_application()
|
||||
128
danmu_activity/settings.py
Normal file
128
danmu_activity/settings.py
Normal file
@@ -0,0 +1,128 @@
|
||||
"""
|
||||
Django settings for danmu_activity project.
|
||||
|
||||
Generated by 'django-admin startproject' using Django 5.0.6.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.0/topics/settings/
|
||||
|
||||
For the full list of settings and their values, see
|
||||
https://docs.djangoproject.com/en/5.0/ref/settings/
|
||||
"""
|
||||
|
||||
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/5.0/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = 'django-insecure-@k0^k91t_(@73sr$a&uo8h)(j8r_^(rtyg)__u*@cpbvw3lk2t'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = []
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'activity',
|
||||
]
|
||||
|
||||
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 = 'danmu_activity.urls'
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [],
|
||||
'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 = 'danmu_activity.wsgi.application'
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': BASE_DIR / 'db.sqlite3',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/5.0/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/5.0/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = 'zh-hans'
|
||||
|
||||
TIME_ZONE = 'Asia/Shanghai'
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
USE_TZ = True
|
||||
|
||||
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
|
||||
# Media files
|
||||
MEDIA_URL = 'media/'
|
||||
MEDIA_ROOT = BASE_DIR / 'media'
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
25
danmu_activity/urls.py
Normal file
25
danmu_activity/urls.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""
|
||||
URL configuration for danmu_activity project.
|
||||
|
||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||
https://docs.djangoproject.com/en/5.0/topics/http/urls/
|
||||
Examples:
|
||||
Function views
|
||||
1. Add an import: from my_app import views
|
||||
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
||||
Class-based views
|
||||
1. Add an import: from other_app.views import Home
|
||||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
||||
Including another URLconf
|
||||
1. Import the include() function: from django.urls import include, path
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('', include('activity.urls')),
|
||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
16
danmu_activity/wsgi.py
Normal file
16
danmu_activity/wsgi.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
WSGI config for danmu_activity project.
|
||||
|
||||
It exposes the WSGI callable as a module-level variable named ``application``.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'danmu_activity.settings')
|
||||
|
||||
application = get_wsgi_application()
|
||||
22
manage.py
Normal file
22
manage.py
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python
|
||||
"""Django's command-line utility for administrative tasks."""
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
"""Run administrative tasks."""
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'danmu_activity.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()
|
||||
Reference in New Issue
Block a user