From e1249f85290e2fe87790c2e9dfd7fa4f2ec3a20e Mon Sep 17 00:00:00 2001 From: xqz_admin Date: Mon, 23 Jun 2025 23:59:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B01.2.2=20=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=9F=A5=E7=9C=8Breadme=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Echo_Z/__pycache__/settings.cpython-39.pyc | Bin 2498 -> 2510 bytes Echo_Z/settings.py | 1 + README.md | 30 +++++++++---- api/__pycache__/views.cpython-39.pyc | Bin 1745 -> 1733 bytes api/views.py | 4 +- comment/__pycache__/admin.cpython-39.pyc | Bin 519 -> 519 bytes comment/__pycache__/models.cpython-39.pyc | Bin 1030 -> 1039 bytes comment/admin.py | 6 +-- .../migrations/0004_alter_comment_table.py | 17 +++++++ ...rchives_id_comment_archives_id_and_more.py | 33 ++++++++++++++ .../0004_alter_comment_table.cpython-39.pyc | Bin 0 -> 549 bytes ...omment_archives_id_and_more.cpython-39.pyc | Bin 0 -> 758 bytes comment/models.py | 13 +++--- db.sqlite3 | Bin 151552 -> 163840 bytes home/__pycache__/models.cpython-39.pyc | Bin 1634 -> 1666 bytes home/__pycache__/views.cpython-39.pyc | Bin 1627 -> 2361 bytes ...articles_table_alter_articleslike_table.py | 21 +++++++++ ...le_alter_articleslike_table.cpython-39.pyc | Bin 0 -> 599 bytes home/models.py | 2 + home/static/{aaa.js => FingerprintJS.js} | 0 home/templates/archives.html | 2 +- home/templates/bottom.html | 29 ++++++------ home/views.py | 42 ++++++++++++++---- siteconfig/__init__.py | 0 .../__pycache__/__init__.cpython-39.pyc | Bin 0 -> 156 bytes siteconfig/__pycache__/admin.cpython-39.pyc | Bin 0 -> 1208 bytes siteconfig/__pycache__/apps.cpython-39.pyc | Bin 0 -> 478 bytes siteconfig/__pycache__/models.cpython-39.pyc | Bin 0 -> 1574 bytes siteconfig/admin.py | 25 +++++++++++ siteconfig/apps.py | 7 +++ siteconfig/migrations/0001_initial.py | 29 ++++++++++++ .../0002_siteconfig_site_author_qq.py | 18 ++++++++ ...3_siteconfig_site_author_email_and_more.py | 23 ++++++++++ siteconfig/migrations/0004_friendshiplink.py | 26 +++++++++++ siteconfig/migrations/0005_siteconfig_icp.py | 18 ++++++++ siteconfig/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-39.pyc | Bin 0 -> 943 bytes ...2_siteconfig_site_author_qq.cpython-39.pyc | Bin 0 -> 653 bytes ..._site_author_email_and_more.cpython-39.pyc | Bin 0 -> 770 bytes .../0004_friendshiplink.cpython-39.pyc | Bin 0 -> 914 bytes .../0005_siteconfig_icp.cpython-39.pyc | Bin 0 -> 639 bytes .../__pycache__/__init__.cpython-39.pyc | Bin 0 -> 167 bytes siteconfig/models.py | 28 ++++++++++++ siteconfig/tests.py | 3 ++ siteconfig/views.py | 3 ++ 45 files changed, 337 insertions(+), 43 deletions(-) create mode 100644 comment/migrations/0004_alter_comment_table.py create mode 100644 comment/migrations/0005_rename_archives_id_comment_archives_id_and_more.py create mode 100644 comment/migrations/__pycache__/0004_alter_comment_table.cpython-39.pyc create mode 100644 comment/migrations/__pycache__/0005_rename_archives_id_comment_archives_id_and_more.cpython-39.pyc create mode 100644 home/migrations/0006_alter_articles_table_alter_articleslike_table.py create mode 100644 home/migrations/__pycache__/0006_alter_articles_table_alter_articleslike_table.cpython-39.pyc rename home/static/{aaa.js => FingerprintJS.js} (100%) create mode 100644 siteconfig/__init__.py create mode 100644 siteconfig/__pycache__/__init__.cpython-39.pyc create mode 100644 siteconfig/__pycache__/admin.cpython-39.pyc create mode 100644 siteconfig/__pycache__/apps.cpython-39.pyc create mode 100644 siteconfig/__pycache__/models.cpython-39.pyc create mode 100644 siteconfig/admin.py create mode 100644 siteconfig/apps.py create mode 100644 siteconfig/migrations/0001_initial.py create mode 100644 siteconfig/migrations/0002_siteconfig_site_author_qq.py create mode 100644 siteconfig/migrations/0003_siteconfig_site_author_email_and_more.py create mode 100644 siteconfig/migrations/0004_friendshiplink.py create mode 100644 siteconfig/migrations/0005_siteconfig_icp.py create mode 100644 siteconfig/migrations/__init__.py create mode 100644 siteconfig/migrations/__pycache__/0001_initial.cpython-39.pyc create mode 100644 siteconfig/migrations/__pycache__/0002_siteconfig_site_author_qq.cpython-39.pyc create mode 100644 siteconfig/migrations/__pycache__/0003_siteconfig_site_author_email_and_more.cpython-39.pyc create mode 100644 siteconfig/migrations/__pycache__/0004_friendshiplink.cpython-39.pyc create mode 100644 siteconfig/migrations/__pycache__/0005_siteconfig_icp.cpython-39.pyc create mode 100644 siteconfig/migrations/__pycache__/__init__.cpython-39.pyc create mode 100644 siteconfig/models.py create mode 100644 siteconfig/tests.py create mode 100644 siteconfig/views.py diff --git a/Echo_Z/__pycache__/settings.cpython-39.pyc b/Echo_Z/__pycache__/settings.cpython-39.pyc index 5b76a10cff970d9bddeabc97eb32acf7c2193dd9..c4ae2ec255503b0a68aae7ac31ab427ce0ef8099 100644 GIT binary patch delta 77 zcmX>kd`_4*k(ZZ?0SLs7L}Xmr$eYTf%^k&2oS9pYlUka2izOpJH#Lemu^{sndvbnm gZfagh6jyO(NosO_URq}Q=7~%%*ckaHS8;j(0JTgR`~Uy| delta 65 zcmX>nd`Or#k(ZZ?0SMX;L}VP;$eYR}&lSZ{oS9pYlUka2izOpJH#Lemu^{sndvbnm UZfai1=DAES*cf>yw{dy^0HXO7(f|Me 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 357d7d759a312618156675ebc7f3bc7c8b4f6e19..873ef53ce040a9cbfdfeec2b16b0d338617141aa 100644 GIT binary patch delta 524 zcmYk2yH3L}6o%tA_cU$AMbI1cA{C-a3_JiAF(3w5=uo;;X>4dAA;`%a6v4z$d1YaP z7hquTf`kMMLl)S02PS+%71fe|>wM?(+x{>orfHj|F7Wj{=?uQcW(D1kTL+!CfCVhM zMq3~nme0@#VFjz#!U%OU3DK|~6Eh(O&cq~}5EEx(lEb-U!OD-{Z&@GtTBJC>=aI{h zeWG4DQuh9%Nb&pU#0i5)b||q!LUneS+D1iompVaZ_LCZI&GXAf^6Aj!St{|s66rEO zXaQuEOE+uNaOk)s=()oS63`-KVkxo5bPd(nYx+j5aB3l1U>&i(Q-u;3O=}6I|G*V4^wMK};=(WBjMN!7ilCPEt>2rO_jdQv`|Wuh&ns*6ZC!lo-;TXSI2&)g z`w}~W1Deo8F>*g@vLvh?j6m3;bgYda@TN*xIJr`pDz5Nyr8-qAqM9o;QTw3zGvi;U zwiOQJSbk5{KA?#u%2(IWuIGQ5HT?QbhG~)&LzJCVqNCpGJJ3)k`e#^BH~MJ%2~A|h z?jWKnnnZj9pVEePhUWx9rGx1pjAYV|1_v_123K-us`Ek%TI$|dR5yiz{fsI;U|qd8 zmbx#vjqULz!z@8&znNI!98)7nJ1Nd{nWKN2|3|x%=r%V7)`UGe!5?E8*60LByGvx@ zm+*0JRunRlbh%fY!l}5zFb&03rVsCQWv*E3B<}e$>drju1{{b4LO<0084xWF?l rhBXH6eqizMZAi=P*EH}WlG{KmX%e`44eH?PF4zSd$|fy~R@sKX57mBB 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 4076ffa7e0f1ce9712953a70ff0748642d89374e..8cf964cd5d84efdf4ea65fe8a89f0558081ed34b 100644 GIT binary patch delta 76 zcmZo?X=mY1ST>oXn)oQN#>X=BLRvxtGbV{uW0{QhZ5b zQch|S$O3NEMrlUQ$;TMO8Ivc=F=@z(0M(>2 zL@}l?L@}i>Mlq)_MX{tX2Qz50RPiKFPG?eQ_S0mYJdMe&zK9d36o~*Ce~ZO8wIq=b z$SP(55*&;yj70)KhMy*X5f6|q;sp^P`64DDaf>q~wW7o=Gc_kAia$9&H#aq}B;Gkc zuLMZn;&jePEP}}Kz~n-UQ;Tl#x+IpQhD;7-7P1S;%uT(;;|bJ|o(fgVomiBdky(~n x9PgPD#Z*{W#0|0yt#1~y-C*yQG?l;)(`F#@#}gIvnP3;^GUO?3bO 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 0000000000000000000000000000000000000000..fac7a76b87b1d23eb4a9d3d0304a7b1006286623 GIT binary patch literal 549 zcmZ8dOHRWu5VakrpQxpGV3$o@0ZW8H2(fB6fJ7rC%fwcbDv47&K`L9=au80!9lT}5 z6(au`7fE&)f}dj{MS zaE_k52yuJ`LjS|gfe@M?PiKl%sVsEtO1t)lRDcL_VBv5EBTwMD?}#~mK{ju3-;%aW zcl^T^BGZm#o{OT2!qI4SNH-Z>EGWw=p?(WY#Yy@gG)=j3D^2@+4YVA%V7V}U#qKjP z3EQSasjE&(SHN*6WDHk}?9r6{;4;#6pb9OK~3Z5&H3vTH|W0$GZU>{p=n z>`e1~PRWfHN|Pw5S@C#4VhbVVvPxt@befl$s8ezgCz3|C*T^H=A0$@j(LZ&~>BDlV zJiDZ2UAt`^53R6|A%f@&ubSQ@^h}q}SuvACe&5{P)VJ5Iqk)B+&hc9OiDT7HW6%2r DgYS~B literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..7fbc0c94c0da5524052e4e7c8ba37b4d1dba2231 GIT binary patch literal 758 zcmah{JCD>b5Vn)-ZZ@|ox`Uc7LfWhlbO@bv0z|F5XDV<~q@t=2}is?oOauA#&PF6h`5DP%bZM$h@0=OIR$ zkxvW}jJ_Pu7$yT0!*qZWIP+*7U=ATjFv@N3nOz4maK^ z%5g;PKj@uBbBc9@R_VmWq9+l;B|=akU4>-Ng!s_O%9rF3;1)HYE)-f5^!>a>AAGK` z0+%#f-0$KmGv^fV)vqq|oHonLPU=q&vx54}wl{6r=*+5mTVbcNXGPhFoMQbPv(s8L zn&@L;dLD5cpMv9fhd!x+syDdU-WdAN*qDx8kcz|LPc({n;J@Ghv3~Y%SG1EUY@}W{ d3%Kh0?fs|DcGg`=@8T!Bp*{7i*3V`Z{skQ#*CYS{ literal 0 HcmV?d00001 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 286058524ac5481750944506b7a540e0447c9ec7..583aba96f07e9a6b7a6d321f2a3c54650b383289 100644 GIT binary patch delta 6401 zcmb7Jd2k!&b;lAQL68(zvL#Uz#Z#svS_HZGVqsa<;vnuD1PItJj0G0J;#gdZ)8j&r z6K8Cvu@$vN)0rghU;?O(WPkbI8 zojn5Xm(+&U<^d<$ zpi}IFoOa6PgPsUIf$2$njiynW#G`Y=ikTXlC>9F5D9MSb@M63GC{+>}q0U!hLNd0e z9*`Zv62bKt3Vzox496LgoCPeG*|Ggh-}t@x;~kJ>^3;#?l^84%`$9KWkL5ZeK_1WM7DXFzNZABc_UJ9!Yez8#P3 z`A`QG$>@-s$EUwEGM7+{!>dE^yRZv>4X(q_!@mn>;4APSz^m}z!BgAa3D|Jo3FQj3 zai=7lpd^OIk1A&%<8EHZj}IxeP%;}A)5TakSrEinzL-7>|BYf;F>ypW3$ZuE^)t}w zjpx^APaQp`T!z@a;GH1OGm0st5{G(=8R&k;IH-2jc5YQwsP!_y_Qh;cvn`{1V)PJs^lFnB4CE&!lcvwYUQ9&(L69k58)> z7Y}In?Z$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zvKCc`DMwI!BtV{er^DyZC<#v>nle+2#oQx<;VM9zluj9-C6 zntBr1{AGAWM=mn{(+wnn?BdrDFBULF@Nc|>H}FfmgbO%>!x+-kMr5H|aFw$OtBhaU zh&UtUR`0-xVttOf3I2-T;+r^vA7Hnp`j80^!BY5?)7ub`#DLFR-{|#<4c?sm5a!Cj z%zi&WXW=j#DxMUz$ov4Y64I*u?Ph(|&2# T-RK?d@`_%`EjGEuJ=OgW`-)!Z diff --git a/home/__pycache__/models.cpython-39.pyc b/home/__pycache__/models.cpython-39.pyc index 8eb28cab90ea3079fb5dfa6df629c0fcde251c8e..1772015fb7bcbd93b9256caa87ab9818b8cf72e6 100644 GIT binary patch delta 425 zcmaFF)5Oc0$ji&c00i+zBQoZ112Q=nS%9!ec(Ns{`sANXq7o2!kRl-< zaf>}ZzPO|)K3;UP8nZp4=;So!7%5?ptOSTaCyQIsW^L6c=NACoq--%8fWj!br(D;bIe zfa;0_CQoAWldYNUfreHy z$4Ci*WW_-QLNS;nIQb*95<5!~Gf*yhqM+ntW0obz4*ANWujg09jZG&=3}mh}5Er93 zOG8Z0(QGo?rrq!M8-$dO>T$WLC*Y7r<06{t{gsB)m~ftA48?riKe>qlnCX&bF2 zM36wBo{>-v&XE(>{v{mdN>$VooQpvGzOfxUfwjJG9{FDLJrmdKfr0Pr{m;6;V)q*z zRzDMm4*F%0?r;~Y$35<2^?8K{SS!4G z+X!pVAkhd-<%)E`Q=w{~NICj6Ek?sZk%mmM%L!2|KC;9G+yE3;fTYo5Q}YNmZ5k7! zGp0;BoWNnXr;Uo3$+%ctS@xGLw0#nnfnlc088dp=b}{eySR)H@mxPef6C7 z<1ANJmW)DQ1-HR_V>sB!I?5Z~>!pb-lojW>s%Rb(C&*Ue5%LLDNV^&NM38`01&dwQ z`PmR_`1AAkT6c?76s@Q`jtBeiw2~oDTcd|CanLHV{wPn!S?lAZJ8Va-?y#S>_OkST zu{CyX}}31qN_X|wt7FV_?6xI5uj3m3v-dy;Wy!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I#qYC+U~ zXTf>Sk|GfoaXV#M=qfXz$`Of38H86e!J}BH9UOBO2}YHjiAX3L{^+)s^eEf9-WJ{T zAm5%~TO#xoxx+;ggPy|u)eehArmQGUIfh$sqN$=ud&7NA0g!T|^>x;x+=QRdQJAxh z0n0=SM|`YIkGpyqN)(Dd7<{~Vix%!XWe$2GI|XDQ&m@SLHv0Sha!CX6NtlbZ@=>e8 zKp(pZ$fk;q_LmiDONaVHQ({SUzh=;2=;xlSfX!EPU-}&aXaYt6qku759Xfd+Jz4{c z$7N7j{9R0d#dYbu)&@70Ld0?L!?}TQG2>p?c}Tab*AA=u{7KSfp?Pdg=pT>&YZJT+ z@VO_zuYqXyxgzVFZ6^IertBX0ugIZv7CNPrsvn)TSne#ox^ow2;M&{Oh{x?@lVt}r zoa8l#@;Z>R)|lWyF^bPGA6L!M(+y4k)Ne}1rZvrKI;-iNra4VbO=VT9d_<2+#nIw3 zem1Z3;A21v#VrdG<>NY1(u5Af+dRloS1`L*JR+Bh7o;}*(`}w8^KTbJkuSrNrH~Zw j$*l!mCaX7<;S;hav~PF&bda(Iq_y?KY#@RHi!}cL`6S!} 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 0000000000000000000000000000000000000000..d2807d8faa30ced6e27d25e018fead17b779b09b GIT binary patch literal 599 zcmZ8dy-pl45VpPEV>vBKuHgabwmF|7B~=tbfzkw;fCO$VvmV{<#ru=>UI8s>c@Q2T z&yaU;n~GNe2^jC)0b-;X&(AkA{zmWYj0wv5zq8^mCFFky-U`QHAJy%lF~m?yDk>=@ z--%%+`a?_vbiuA8$qfHVviJ^hB%^*@mGe&bWmCI6q~1!5!9J>+q5&eQA=pmmR7SuT zaTsj)4IBK}jDkOBa%8q}LE^WMHj^{vdC^oLC$rh?v(jB(<`$eSe}PXnkxvfR`2eqV z1wQWeg$0>zAVWjCf&IYt<7~?(N(Ho1eymj0n57MVs?_hLw(Cl2poQ8%otNM`hIIUg z1KUG))EKZQVT~U*EvzqbOS+GU8O(hvP91bk$YQDMt4|`w7SUezMNG4EP7$B22$^mf!V4sZ7;hBcaKorE}A4_Pdw(7QTE9B`h6HM$64gJ h%|h4nW@;`5T0{Qz^DA$HV|?;;b(?Qtx(g>rqh~s&q%Z&g literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..46beb22f2b8d746a5bc41b42ebd6d520d3d4b47d GIT binary patch literal 156 zcmYe~<>g`kf(wTuGC=fW5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;!HcerR!OQL%nh zMrmSRm63jOeoCr-L1jrsex81DW^O@FYH6mvYjQ?@d=!vhlA4^KmzJ5XA0MBYmst`Y YuUAlci^C>2KczG$)edCzXCP((09MZ?K>z>% literal 0 HcmV?d00001 diff --git a/siteconfig/__pycache__/admin.cpython-39.pyc b/siteconfig/__pycache__/admin.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6cffe8165015894549a88a3280f8c0b92d7449c8 GIT binary patch literal 1208 zcmZuw%We}f6!l{!nS@EoqXMboDY^-Z1R=3QRS^_eKv)!nIzqCBv6DukD!dA{>aten-Y#m@ z{y+!R!rBda8fW0#{P=AsqVjbvR5veo4q{b87C(v14_6O83)Ch!0tJ|(fb;?EFC5Sl z)We)`dh7+x335>2LNiCN?Z%~em1n)U|I+rW>Y9QS%feLX>(&j&(G8p8LPawECbVzEeKGlwORi}g6_J_d`Kf?YgKNO6E||m35)JW;%+XJG>JI75 znUW!$!>p(7%$*~QzMyQ=L1ks~4nu@dSv^8CZ;Gd6N~g};!DtU<6r-_F zrKa$lc6zx?btM{vSziRcFguE~K7-mR)-}eWBvgvAQ}lPM^H~Y0I>BHZW{1x@5j@)| zCNSZwqvEtk#5nHkM1!0K5SJpdyXjalw2O&c2Vh34$_Il8!FAHaKK04r#sx{c%JwDL zK-8=hh}N0mGER)|Gd3EB$yvou05{A-6-l`0q#I}0BatMG$-B^VVK$6+<1KDqIC0 z4)TbHZRUzP2~@Yu&kTceb#l;Tp9GXstHxVzWGphS266E|&h{-0z1~|UnblGPrK?%P zq1$rgeRy6zFy^5#kBqs1Z9NP7F%<5=RR)+xq=~z&YeAC_VT*Yi248}Jr77#%%cK-- zaS(~3jPp!cnFRJ5SnR27Rid;fMIUAbK*FPBXSUPq%x_OzXZT>%$+Iz9s)fR?# Q?9P4c6OVd$ea*xF002utF8}}l literal 0 HcmV?d00001 diff --git a/siteconfig/__pycache__/apps.cpython-39.pyc b/siteconfig/__pycache__/apps.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d75b370e8e023d48203c7018f1b8e0d74c8f87b1 GIT binary patch literal 478 zcmYk2y-ve05PHA^Bf18PCQ)}=xqFP0m-O;G-b6Qp(oUV=wJNZmn# ziKp<&PeG2P~UZT+7^P`$p#DRLP3*i1IE}sMPm? zcdlfvJQ|cdneTZ%{LRZ|MUW<*3gax2W$2ywLCPrjzdd<8%aohVasnVTWz_=J#ult9 iHgt&Yt~xfkdBapR+5fd`%QUOo`*ll)X1>bg+T;gufPbq1 literal 0 HcmV?d00001 diff --git a/siteconfig/__pycache__/models.cpython-39.pyc b/siteconfig/__pycache__/models.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..902922216700676d973ea1fdd78366a7d879b1db GIT binary patch literal 1574 zcma)6O-~a+7~aozTiODJ`0*2Zp@}h`jFJ#BCeoM?56)$>?F@8b`!(C5a58`&(GW0d zltd3CCWa6jj4{Lm@IUryO6d>a;zi$gwv<(Ra5ghL&pYqTJnz@o$z)uC_Iu$$anDec zp9sPYWXd>n?g6Rx;5J>{K$U zA1PHBcfA6_a5DjnL-$_5z!jo0g=k!#Gnk53tZBsTB158xL?*08SaeM%(H^!Wwz}Fe zsU7R0xI}S@24HVO>J9+uBufG5)QUzDY>*ADDkRBWjln>pz5D~Vc9xs%=GW7+Kz6jgetftaQffW<)_K!xeR<~x z{O(NLYkhilwDr8TzIV>oNMRhhcL|15Uo(~HOe5f3Vlo3PHjtKN9v6t-1|iyS~Np zv~K5JzO9HfoG6E1H?#LWF1#!$Hth1!m23fWC|g~u7c1qg=ai~0Z#daog<^#gz;#}b z(aHv?HdbBq4Wyrf^E@=cQVsaTC`=3Ji_?a4>=V#E%z37QAGDkpfVpG>32b=WojKzs zMqtg4QtH(Or3gF?21Q*;hrHKa&Sg>}35x=$2n?}6Wj{7iw8f;uT}EQaUwV)X$*J7{ zGesatg(bBb84hD!vK^NsrHFB_Ae=lW2?^)<;=_tyM0W~RX|}k4clR6|%#gecBbx5v zqNS$b8-h>%^^_^s&m~mveYggjP7|tIa(#;z3eIE^D7Xj|T$Dw@&6b~<6b>&lujo|o zI^}tRr^=jft-tKNK4^W|ZGC(!@SzAxWeJ{R^uH-S^7oxG%>_P&p)11hhuL%)`o9^L%UJzlE-r#D8J+2wOl728F#Nm}%O;3hzmOp@jA!>|3{^ljWBM^R lXP0LyV=NzJnmL8fuZ*J9>1T>>T@UK^26|BzLPAfc{{SuBl8pcW literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..b54740cdffdc237824ac9d9de7eaeee67b0e8b21 GIT binary patch literal 943 zcmYjQ&1=*^6rW78-&wob>RB(sUYhDzq*|?bXc4NQxrFS#X?C{RBu)}_d#rj~s-S4W zyGXGV#Dj<0qyNKPrQI(60fHj+WwNC^LmuxpZ{F8$Ufg=UN^m{;@v!qtC*)@aCYOO= z9>4f93Lv2Qq^H?hkJ?ltcL-3>Ul7ol*43ZuwhqP$X%ErR!AjjSXt)h1KyhHKQYhhB1VP7y zjj=h#^)Ws(##3Y5$gx*|vv3Y$Pk+#1W}thTU4`>l`~_KAI;r};tgi5cErh`;_ax=8 zDCyl>O+%V)nuJbUFgIZ!YmwkRSM;4V)|Zu-3GVuQok{Zv6Rj|2PT=+!8ZeYnN5|M| zYN8nKy&i6F9lRP0Kkh2N+-Hu@0x#)^j2GEZKA5Z%3gw!6ZEuad z@GHJ@DE$Q_w2WPvDhskf*2OCyrPg?QDhTHu~lZ%*LOW!Ln9|q^=d0?yIQZ;kC{|* zlDyS1R=3BFW_+HSUbAu3D45*r(amm(>mOgQKm8oXoZ2ObEuY&774Q$N6{?;ZyLvD5 zrZ<8q-U&>~ydsZm)oGC@zw}!in5ux`gm4UxaDHFM1`s_vKv}4 z%i=}V^sGdDx18eeV+vf;89PuuJnZOnxYX_qEby2UbO{ajQ5*#!e#d{Ky=O1-$fmI4 gs_su=a6_WHbQM+Au`&_<%6 z;3puYNR(9kk8LSV_ZK3eFze&EYglVX^X83rcHXSm-HjQo_w}3nlgrpI3$~X};E=X{ zKn55%C99m&sod0c*mDLhcpn*f=*+wiUh0AWij9IL<+71$;;P7$Xp35EGpK67QcoVlIwsfYe7umx~18-fo33}ATSL3m-AkeKKn6R(-fO(VELm)J4U z%XM{o6uNv)AfQ6VM8y$(GxzKxk+T3`ug zZ@XaAbm6K76=<5{QEWoq|HQe8Ij2Lq63O4;yy-+~53&ewjuKE#3e<|`$xL_z@XQua zo`unqT&NzK_^51g?bmbsJE^Zs-J#6hT*>6MMx~Q9?}U7JkW6TZ$^49zl8G*=d5K+- zJe}kN28-tR5%s?R$f m`6hyykXgMCCw;elk3G5RVddSW^Gx_?rQ2gGg|_nC^8NrnJ>Xve literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..4a02892fa76ec85ade21475a668a387f3ba2cb49 GIT binary patch literal 914 zcmZWnPiqrF6rY{lq}eppXnPdB3GvV^>QSUxtq8Uk6>%@)ByWytqC~8Jl=2KpLz3pk1s6L39irjd6c?@{Ipk{F1qwkz2S`Z4={cb*yne+#AgcX2@Nie43Uec`OQD8$HSnPh^COD5af%lv zxaYz-IFGT-T^BBlT+HUfMJ#R6_#0<6*#fm3h)$MvWiPz8va)i6O)pB7@nR5Viiw2F znDG=?k||-%tt%-~(2>j^$#lz52~XAyeR!|snFfYrtfK@U2r%=xk_lHswk3wf*Fs4i z%WYvAuY_u6TCkKS!YpZZoZzc6O%3|WFA7N|EEds*<P6;Y21~)JILX>eZ%-`5mytnp5@|noW2uv8GTFf=UMO+iPb?E6+GR(9&|8QkPoqO zX`p42$D)wI{Z5pz5b;^VgXwSv*!r7n+5^k}az0dc_$_Jr5{jBjPrQofP`czao#rvE wQU~|3_uD%uJvXuWKJ9+m1wsbVzzwkmC%>V!Z literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..c4966dd1e17d8da60aab1439421b4cbe24f4a026 GIT binary patch literal 639 zcmYjO&5G1O5bjPVGf9}01rPcJLN1#@^d_>htm45%5D{}}vZFFu&*GhAUqYsh7eJ!*hWt-d$@*14On#TN|pBda=E-C zS6X2Urc!;a+E+TDCRV7Tx9ogF`M99)_~7Z;w@<&nem?v1GZA(UxXQj*`fRa=Mq&#!^z^NDPNCy?P?tY>}fD; z3x!5|ZmjSDz(eg`kf(wTuGC=fW5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;!HIerR!OQL%nh zMrmSRm63jOeoCr-L1jrsex81DW^O@FYH6mvYjQ?@d=!vhlA4^KmzJ5XpPQLplvt9P jpI59OAD@|*SrQ+wS5SG2!zMRBr8Fni4rI$`AZ7pnJHRTq literal 0 HcmV?d00001 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.