diff --git a/Echo_Z/__pycache__/settings.cpython-39.pyc b/Echo_Z/__pycache__/settings.cpython-39.pyc index 5b76a10..c4ae2ec 100644 Binary files a/Echo_Z/__pycache__/settings.cpython-39.pyc and b/Echo_Z/__pycache__/settings.cpython-39.pyc differ diff --git a/Echo_Z/settings.py b/Echo_Z/settings.py index 1a80cdc..fb5d87d 100644 --- a/Echo_Z/settings.py +++ b/Echo_Z/settings.py @@ -35,6 +35,7 @@ INSTALLED_APPS = [ 'home', 'api', 'comment', + 'siteconfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/README.md b/README.md index 32e3957..89159bd 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,21 @@ Django、simpleui、python3 # 目录结构描述 - ├── ReadMe.md // 帮助文档 - - ├── home // 文章相关app - - ├── api // 项目api - - ├── comment // 评论app - - └── Echo-Z // 项目配置等目录 + ├── api // 项目api + + ├── comment // 评论app + + ├── Echo-Z // 项目配置等目录 + + ├── home // 文章相关app + + ├── db.sqlite3 // 项目数据库 + + ├── manage.py // 项目管理主文件 + + ├── ReadMe.md // 帮助文档 + + └── requirements.txt // 项目依赖库列表 # 使用说明 运行命令安装依赖 @@ -45,3 +51,9 @@ python manage.py runserver 9999 2.文章详情页评论列表显示 3.文章详情页评论发布 4.文章详情页点赞与取消点赞 + +###### 1.2.2 + 2025年6月23日 + 新增 + 1.友联管理 + 2.站点设置 \ No newline at end of file diff --git a/api/__pycache__/views.cpython-39.pyc b/api/__pycache__/views.cpython-39.pyc index 357d7d7..873ef53 100644 Binary files a/api/__pycache__/views.cpython-39.pyc and b/api/__pycache__/views.cpython-39.pyc differ diff --git a/api/views.py b/api/views.py index f48a03a..093a8ac 100644 --- a/api/views.py +++ b/api/views.py @@ -4,13 +4,13 @@ from django.shortcuts import render,HttpResponse from django.http import JsonResponse,HttpResponseNotAllowed,HttpResponseRedirect,JsonResponse from django.views.decorators.http import require_http_methods -from comment.models import comment +from comment.models import * from home.models import * # Create your views here. @require_http_methods(["POST"]) def add_comment(request, id): - create_comment = comment.objects.create(comment_Content=request.POST.get("comment"),comment_User=request.POST.get("username"), comment_Time=datetime.now(), archives_Id=id, qq=request.POST.get("qqNum")) + create_comment = Comment.objects.create(comment_Content=request.POST.get("comment"),comment_User=request.POST.get("username"), comment_Time=datetime.now(), archives_Id=id, qq=request.POST.get("qqNum")) create_comment.save() return HttpResponseRedirect("/archives/"+id) diff --git a/comment/__pycache__/admin.cpython-39.pyc b/comment/__pycache__/admin.cpython-39.pyc index 4076ffa..8cf964c 100644 Binary files a/comment/__pycache__/admin.cpython-39.pyc and b/comment/__pycache__/admin.cpython-39.pyc differ diff --git a/comment/__pycache__/models.cpython-39.pyc b/comment/__pycache__/models.cpython-39.pyc index cfd4d8f..9cf5992 100644 Binary files a/comment/__pycache__/models.cpython-39.pyc and b/comment/__pycache__/models.cpython-39.pyc differ diff --git a/comment/admin.py b/comment/admin.py index dbef896..36a0fee 100644 --- a/comment/admin.py +++ b/comment/admin.py @@ -1,7 +1,7 @@ from django.contrib import admin -from comment.models import comment +from comment.models import Comment # Register your models here. -@admin.register(comment) +@admin.register(Comment) class CommentAdmin(admin.ModelAdmin): - list_display = ["comment_Content","comment_User","comment_Time", "archives_Id"] \ No newline at end of file + list_display = ["comment_content","comment_user","comment_time", "archives_id"] \ No newline at end of file diff --git a/comment/migrations/0004_alter_comment_table.py b/comment/migrations/0004_alter_comment_table.py new file mode 100644 index 0000000..986a9e7 --- /dev/null +++ b/comment/migrations/0004_alter_comment_table.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.23 on 2025-06-23 03:17 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('comment', '0003_comment_qq_alter_comment_archives_id'), + ] + + operations = [ + migrations.AlterModelTable( + name='comment', + table='Comment', + ), + ] diff --git a/comment/migrations/0005_rename_archives_id_comment_archives_id_and_more.py b/comment/migrations/0005_rename_archives_id_comment_archives_id_and_more.py new file mode 100644 index 0000000..1926121 --- /dev/null +++ b/comment/migrations/0005_rename_archives_id_comment_archives_id_and_more.py @@ -0,0 +1,33 @@ +# Generated by Django 4.2.23 on 2025-06-23 03:21 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('comment', '0004_alter_comment_table'), + ] + + operations = [ + migrations.RenameField( + model_name='comment', + old_name='archives_Id', + new_name='archives_id', + ), + migrations.RenameField( + model_name='comment', + old_name='comment_Content', + new_name='comment_content', + ), + migrations.RenameField( + model_name='comment', + old_name='comment_Time', + new_name='comment_time', + ), + migrations.RenameField( + model_name='comment', + old_name='comment_User', + new_name='comment_user', + ), + ] diff --git a/comment/migrations/__pycache__/0004_alter_comment_table.cpython-39.pyc b/comment/migrations/__pycache__/0004_alter_comment_table.cpython-39.pyc new file mode 100644 index 0000000..fac7a76 Binary files /dev/null and b/comment/migrations/__pycache__/0004_alter_comment_table.cpython-39.pyc differ diff --git a/comment/migrations/__pycache__/0005_rename_archives_id_comment_archives_id_and_more.cpython-39.pyc b/comment/migrations/__pycache__/0005_rename_archives_id_comment_archives_id_and_more.cpython-39.pyc new file mode 100644 index 0000000..7fbc0c9 Binary files /dev/null and b/comment/migrations/__pycache__/0005_rename_archives_id_comment_archives_id_and_more.cpython-39.pyc differ diff --git a/comment/models.py b/comment/models.py index fe2f76a..af96fdb 100644 --- a/comment/models.py +++ b/comment/models.py @@ -1,11 +1,11 @@ from django.db import models # Create your models here. -class comment(models.Model): - comment_Content = models.TextField(verbose_name="评论内容") - comment_User = models.CharField(max_length=100,verbose_name="评论者") - comment_Time = models.DateTimeField(verbose_name="评论时间") - archives_Id = models.IntegerField(default=0, verbose_name="文章id") +class Comment(models.Model): + comment_content = models.TextField(verbose_name="评论内容") + comment_user = models.CharField(max_length=100,verbose_name="评论者") + comment_time = models.DateTimeField(verbose_name="评论时间") + archives_id = models.IntegerField(default=0, verbose_name="文章id") qq = models.IntegerField(default=1000, verbose_name="评论者qq号") def __str__(self): @@ -13,4 +13,5 @@ class comment(models.Model): class Meta: verbose_name = "评论" - verbose_name_plural = "评论管理" \ No newline at end of file + verbose_name_plural = "评论管理" + db_table = "Comment" \ No newline at end of file diff --git a/db.sqlite3 b/db.sqlite3 index 2860585..583aba9 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/home/__pycache__/models.cpython-39.pyc b/home/__pycache__/models.cpython-39.pyc index 8eb28ca..1772015 100644 Binary files a/home/__pycache__/models.cpython-39.pyc and b/home/__pycache__/models.cpython-39.pyc differ diff --git a/home/__pycache__/views.cpython-39.pyc b/home/__pycache__/views.cpython-39.pyc index 59b6c65..2414368 100644 Binary files a/home/__pycache__/views.cpython-39.pyc and b/home/__pycache__/views.cpython-39.pyc differ diff --git a/home/migrations/0006_alter_articles_table_alter_articleslike_table.py b/home/migrations/0006_alter_articles_table_alter_articleslike_table.py new file mode 100644 index 0000000..96cee03 --- /dev/null +++ b/home/migrations/0006_alter_articles_table_alter_articleslike_table.py @@ -0,0 +1,21 @@ +# Generated by Django 4.2.23 on 2025-06-23 03:17 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('home', '0005_articleslike'), + ] + + operations = [ + migrations.AlterModelTable( + name='articles', + table='Articles', + ), + migrations.AlterModelTable( + name='articleslike', + table='ArticlesLike', + ), + ] diff --git a/home/migrations/__pycache__/0006_alter_articles_table_alter_articleslike_table.cpython-39.pyc b/home/migrations/__pycache__/0006_alter_articles_table_alter_articleslike_table.cpython-39.pyc new file mode 100644 index 0000000..d2807d8 Binary files /dev/null and b/home/migrations/__pycache__/0006_alter_articles_table_alter_articleslike_table.cpython-39.pyc differ diff --git a/home/models.py b/home/models.py index d8f8a3a..c0397c2 100644 --- a/home/models.py +++ b/home/models.py @@ -16,6 +16,7 @@ class Articles(models.Model): class Meta: verbose_name = "文章" verbose_name_plural = "文章管理" + db_table = "Articles" def __str__(self): return self.title @@ -27,6 +28,7 @@ class ArticlesLike(models.Model): class Meta: verbose_name = "点赞" verbose_name_plural = "点赞管理" + db_table = "ArticlesLike" def __str__(self): return self.uuid \ No newline at end of file diff --git a/home/static/aaa.js b/home/static/FingerprintJS.js similarity index 100% rename from home/static/aaa.js rename to home/static/FingerprintJS.js diff --git a/home/templates/archives.html b/home/templates/archives.html index 0175edd..e7e7766 100644 --- a/home/templates/archives.html +++ b/home/templates/archives.html @@ -125,7 +125,7 @@ const active_path = "M736 128c-65.952 0-128.576 25.024-176.384 70.464-4.576 4.32-28.672 28.736-47.328 47.68L464.96 199.04C417.12 153.216 354.272 128 288 128 146.848 128 32 242.848 32 384c0 82.432 41.184 144.288 76.48 182.496l316.896 320.128C450.464 911.68 478.304 928 512 928s61.568-16.32 86.752-41.504l316.736-320 2.208-2.464C955.904 516.384 992 471.392 992 384c0-141.152-114.848-256-256-256z" const path = document.getElementById('link_svg'); - const fpPromise = import('{% static "aaa.js" %}').then(FingerprintJS => FingerprintJS.load()); + const fpPromise = import('{% static "FingerprintJS.js" %}').then(FingerprintJS => FingerprintJS.load()); fpPromise.then(fp => fp.get()).then(result => {localStorage.setItem("uuid",result.visitorId)}); document.addEventListener('DOMContentLoaded', function() { diff --git a/home/templates/bottom.html b/home/templates/bottom.html index 2910a96..ad2dd68 100644 --- a/home/templates/bottom.html +++ b/home/templates/bottom.html @@ -5,7 +5,7 @@ {% block sitename %} - 我的个人博客 + {{ site_config.title }} {% endblock %} {% block stylesheethref %} @@ -16,7 +16,7 @@
- +
- 欢迎回来 - 个人头像 + {{ site_config.site_author_name }} + 个人头像
@@ -67,27 +67,28 @@ diff --git a/home/views.py b/home/views.py index 50f9e9f..d16ac7d 100644 --- a/home/views.py +++ b/home/views.py @@ -1,12 +1,34 @@ from django.shortcuts import render, HttpResponse from home.models import * -from comment.models import comment +from comment.models import * +from siteconfig.models import * # Create your views here. +def get_site_config(): + siteconf = SiteConfig.objects.all()[0] + siteconfig = { + 'title': siteconf.site_name, + 'site_author_name': siteconf.site_author_name, + 'site_author_qq': siteconf.site_author_qq, + "site_author_email": siteconf.site_author_email, + "icp": siteconf.icp, + } + return siteconfig + +def get_friendship_links(): + friendship_links = [] + FriendshipLinks = FriendshipLink.objects.all() + for link in FriendshipLinks: + friendship_links.append({"link": link.friendship_site_link,"name": link.friendship_site_name}) + return friendship_links def index(request): artchle = Articles.objects.all() - artchles = {"artchles": []} + artchles = { + "artchles": [], + "site_config": get_site_config(), + "FriendshipLinks": get_friendship_links() + } for i in artchle: a = { "id":i.id, @@ -14,9 +36,10 @@ def index(request): "abstract": i.abstract, "created": i.created, "stat": i.stat, - "read": i.read + "read": i.read, } artchles["artchles"].append(a) + return render(request, 'index.html', context=artchles) @@ -30,7 +53,7 @@ def archives(request, id): next_article = Articles.objects.filter(id__gt=id).order_by('id').first() next_id = next_article.id if next_article else id next_id_title = next_article.title if next_article else "暂无下一篇" - comments = comment.objects.filter(archives_Id=id).order_by("-comment_Time").all() + comments = Comment.objects.filter(archives_id=id).order_by("-comment_time").all() a = { "id": i.id, "title": i.title, @@ -40,20 +63,23 @@ def archives(request, id): "read": i.read, "content": i.content, "author": i.author, + "site_config": get_site_config(), "previous":{ "id": previous_id, "title": previous_id_title, },"next":{ "id": next_id, "title": next_id_title, - },"comments": [] + },"comments": [], + "FriendshipLinks": get_friendship_links() } + print(a) for c in comments: com = { "id": c.id, - "comment_Content": c.comment_Content, - "comment_User": c.comment_User, - "comment_Time": c.comment_Time, + "comment_Content": c.comment_content, + "comment_User": c.comment_user, + "comment_Time": c.comment_time, "qq": c.qq, } a["comments"].append(com) diff --git a/siteconfig/__init__.py b/siteconfig/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/siteconfig/__pycache__/__init__.cpython-39.pyc b/siteconfig/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000..46beb22 Binary files /dev/null and b/siteconfig/__pycache__/__init__.cpython-39.pyc differ diff --git a/siteconfig/__pycache__/admin.cpython-39.pyc b/siteconfig/__pycache__/admin.cpython-39.pyc new file mode 100644 index 0000000..6cffe81 Binary files /dev/null and b/siteconfig/__pycache__/admin.cpython-39.pyc differ diff --git a/siteconfig/__pycache__/apps.cpython-39.pyc b/siteconfig/__pycache__/apps.cpython-39.pyc new file mode 100644 index 0000000..d75b370 Binary files /dev/null and b/siteconfig/__pycache__/apps.cpython-39.pyc differ diff --git a/siteconfig/__pycache__/models.cpython-39.pyc b/siteconfig/__pycache__/models.cpython-39.pyc new file mode 100644 index 0000000..9029222 Binary files /dev/null and b/siteconfig/__pycache__/models.cpython-39.pyc differ diff --git a/siteconfig/admin.py b/siteconfig/admin.py new file mode 100644 index 0000000..8830775 --- /dev/null +++ b/siteconfig/admin.py @@ -0,0 +1,25 @@ +from django.contrib import admin +from django.core.exceptions import ObjectDoesNotExist + +from siteconfig.models import * +# Register your models here. + +@admin.register(SiteConfig) +class SiteConfigAdmin(admin.ModelAdmin): + list_display = ["site_name","site_author_name","site_author_qq","site_author_email","site_describe","site_keyword","icp"] + def save_model(self, request, obj, form, change): + # 检查是否已存在数据 + try: + existing_obj = SiteConfig.objects.get() + # 如果存在,更新现有对象 + existing_obj.__dict__.update(obj.__dict__) + existing_obj.save() + # 删除新创建的对象(因为我们已经更新了现有对象) + # obj.delete() + except ObjectDoesNotExist: + # 如果不存在,创建新对象 + super().save_model(request, obj, form, change) + +@admin.register(FriendshipLink) +class FriendshipLinkAdmin(admin.ModelAdmin): + list_display = ["friendship_site_link","friendship_site_name"] \ No newline at end of file diff --git a/siteconfig/apps.py b/siteconfig/apps.py new file mode 100644 index 0000000..05a32bd --- /dev/null +++ b/siteconfig/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class SiteconfigConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'siteconfig' + verbose_name = '站点设置' diff --git a/siteconfig/migrations/0001_initial.py b/siteconfig/migrations/0001_initial.py new file mode 100644 index 0000000..3575e60 --- /dev/null +++ b/siteconfig/migrations/0001_initial.py @@ -0,0 +1,29 @@ +# Generated by Django 4.2.23 on 2025-06-23 03:17 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='SiteConfig', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('site_name', models.CharField(max_length=255, verbose_name='网站名称')), + ('site_author_name', models.CharField(max_length=255, verbose_name='站长昵称')), + ('site_describe', models.CharField(max_length=255, verbose_name='站点描述')), + ('site_keyword', models.CharField(max_length=255, verbose_name='站点关键字')), + ], + options={ + 'verbose_name': '设置', + 'verbose_name_plural': '站点设置', + 'db_table': 'SiteConfig', + }, + ), + ] diff --git a/siteconfig/migrations/0002_siteconfig_site_author_qq.py b/siteconfig/migrations/0002_siteconfig_site_author_qq.py new file mode 100644 index 0000000..a9f8343 --- /dev/null +++ b/siteconfig/migrations/0002_siteconfig_site_author_qq.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.23 on 2025-06-23 14:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('siteconfig', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='siteconfig', + name='site_author_qq', + field=models.CharField(default=0, max_length=255, verbose_name='站点qq'), + ), + ] diff --git a/siteconfig/migrations/0003_siteconfig_site_author_email_and_more.py b/siteconfig/migrations/0003_siteconfig_site_author_email_and_more.py new file mode 100644 index 0000000..a85e2bd --- /dev/null +++ b/siteconfig/migrations/0003_siteconfig_site_author_email_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.23 on 2025-06-23 15:15 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('siteconfig', '0002_siteconfig_site_author_qq'), + ] + + operations = [ + migrations.AddField( + model_name='siteconfig', + name='site_author_email', + field=models.CharField(default=0, max_length=255, verbose_name='站点长邮箱'), + ), + migrations.AlterField( + model_name='siteconfig', + name='site_author_qq', + field=models.CharField(default=0, max_length=255, verbose_name='站长qq'), + ), + ] diff --git a/siteconfig/migrations/0004_friendshiplink.py b/siteconfig/migrations/0004_friendshiplink.py new file mode 100644 index 0000000..a7fa5aa --- /dev/null +++ b/siteconfig/migrations/0004_friendshiplink.py @@ -0,0 +1,26 @@ +# Generated by Django 4.2.23 on 2025-06-23 15:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('siteconfig', '0003_siteconfig_site_author_email_and_more'), + ] + + operations = [ + migrations.CreateModel( + name='FriendshipLink', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('friendship_site_link', models.CharField(max_length=255, verbose_name='友链地址')), + ('friendship_site_name', models.CharField(max_length=255, verbose_name='友链名称')), + ], + options={ + 'verbose_name': '设置', + 'verbose_name_plural': '友链管理', + 'db_table': 'FriendshipLink', + }, + ), + ] diff --git a/siteconfig/migrations/0005_siteconfig_icp.py b/siteconfig/migrations/0005_siteconfig_icp.py new file mode 100644 index 0000000..e146dec --- /dev/null +++ b/siteconfig/migrations/0005_siteconfig_icp.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.23 on 2025-06-23 15:47 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('siteconfig', '0004_friendshiplink'), + ] + + operations = [ + migrations.AddField( + model_name='siteconfig', + name='icp', + field=models.CharField(default='', max_length=255, verbose_name='ICP备案号'), + ), + ] diff --git a/siteconfig/migrations/__init__.py b/siteconfig/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/siteconfig/migrations/__pycache__/0001_initial.cpython-39.pyc b/siteconfig/migrations/__pycache__/0001_initial.cpython-39.pyc new file mode 100644 index 0000000..b54740c Binary files /dev/null and b/siteconfig/migrations/__pycache__/0001_initial.cpython-39.pyc differ diff --git a/siteconfig/migrations/__pycache__/0002_siteconfig_site_author_qq.cpython-39.pyc b/siteconfig/migrations/__pycache__/0002_siteconfig_site_author_qq.cpython-39.pyc new file mode 100644 index 0000000..9630890 Binary files /dev/null and b/siteconfig/migrations/__pycache__/0002_siteconfig_site_author_qq.cpython-39.pyc differ diff --git a/siteconfig/migrations/__pycache__/0003_siteconfig_site_author_email_and_more.cpython-39.pyc b/siteconfig/migrations/__pycache__/0003_siteconfig_site_author_email_and_more.cpython-39.pyc new file mode 100644 index 0000000..13e4251 Binary files /dev/null and b/siteconfig/migrations/__pycache__/0003_siteconfig_site_author_email_and_more.cpython-39.pyc differ diff --git a/siteconfig/migrations/__pycache__/0004_friendshiplink.cpython-39.pyc b/siteconfig/migrations/__pycache__/0004_friendshiplink.cpython-39.pyc new file mode 100644 index 0000000..4a02892 Binary files /dev/null and b/siteconfig/migrations/__pycache__/0004_friendshiplink.cpython-39.pyc differ diff --git a/siteconfig/migrations/__pycache__/0005_siteconfig_icp.cpython-39.pyc b/siteconfig/migrations/__pycache__/0005_siteconfig_icp.cpython-39.pyc new file mode 100644 index 0000000..c4966dd Binary files /dev/null and b/siteconfig/migrations/__pycache__/0005_siteconfig_icp.cpython-39.pyc differ diff --git a/siteconfig/migrations/__pycache__/__init__.cpython-39.pyc b/siteconfig/migrations/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000..238b2d1 Binary files /dev/null and b/siteconfig/migrations/__pycache__/__init__.cpython-39.pyc differ diff --git a/siteconfig/models.py b/siteconfig/models.py new file mode 100644 index 0000000..bf07821 --- /dev/null +++ b/siteconfig/models.py @@ -0,0 +1,28 @@ +from django.db import models + +# Create your models here. +class SiteConfig(models.Model): + site_name = models.CharField(max_length=255,verbose_name='网站名称') + site_author_name = models.CharField(max_length=255,verbose_name='站长昵称') + site_author_qq = models.CharField(default=0,max_length=255,verbose_name='站长qq') + site_author_email = models.CharField(default=0, max_length=255, verbose_name='站点长邮箱') + site_describe = models.CharField(max_length=255,verbose_name='站点描述') + site_keyword = models.CharField(max_length=255,verbose_name='站点关键字') + icp = models.CharField(default="",max_length=255,verbose_name='ICP备案号') + + + class Meta: + verbose_name = "设置" + verbose_name_plural = "站点设置" + db_table = "SiteConfig" + + def __str__(self): + return "站点设置" + +class FriendshipLink(models.Model): + friendship_site_link = models.CharField(max_length=255,verbose_name='友链地址') + friendship_site_name = models.CharField(max_length=255,verbose_name='友链名称') + class Meta: + verbose_name = "设置" + verbose_name_plural = "友链管理" + db_table = "FriendshipLink" diff --git a/siteconfig/tests.py b/siteconfig/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/siteconfig/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/siteconfig/views.py b/siteconfig/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/siteconfig/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here.