Selaa lähdekoodia

修正到能用水平

Shellmiao 4 vuotta sitten
vanhempi
commit
b01c2809cd
37 muutettua tiedostoa jossa 329 lisäystä ja 147 poistoa
  1. 8 0
      MyBlog/.idea/.gitignore
  2. 28 0
      MyBlog/.idea/MyBlog.iml
  3. 17 0
      MyBlog/.idea/inspectionProfiles/Project_Default.xml
  4. 6 0
      MyBlog/.idea/inspectionProfiles/profiles_settings.xml
  5. 4 0
      MyBlog/.idea/misc.xml
  6. 8 0
      MyBlog/.idea/modules.xml
  7. 6 0
      MyBlog/.idea/vcs.xml
  8. 21 1
      MyBlog/MyBlog/settings.py
  9. 3 2
      MyBlog/article/migrations/0001_initial.py
  10. 0 20
      MyBlog/article/migrations/0002_articlepost_summary.py
  11. 1 1
      MyBlog/comment/migrations/0001_initial.py
  12. BIN
      MyBlog/db.sqlite3
  13. BIN
      MyBlog/media/article/20210307/01q7x3.jpg
  14. BIN
      MyBlog/media/article/20210307/1f441673b2957690f67ff121081d11f6.jpg
  15. BIN
      MyBlog/media/article/20210307/4bdc01d290838558dfaea5f390b28712.jpg
  16. BIN
      MyBlog/media/article/20210307/4dd37m.jpg
  17. BIN
      MyBlog/media/article/20210307/737934.jpg
  18. BIN
      MyBlog/media/article/20210307/php路线.png
  19. BIN
      MyBlog/media/article/20210307/技术树.png
  20. BIN
      MyBlog/media/article/20210308/392zpd.jpg
  21. BIN
      MyBlog/media/article/20210308/4769624e404775ab1f8e0ccdacb73671.jpg
  22. BIN
      MyBlog/media/article/20210309/4a91ad8e67b2c92de2418e5913767a47.jpg
  23. BIN
      MyBlog/media/article/20210718/16210519961.jpg
  24. BIN
      MyBlog/media/article/20210718/81aemvs0uhb11.png
  25. BIN
      MyBlog/media/article/20210718/81aemvs0uhb11_XcMBN4l.png
  26. BIN
      MyBlog/media/article/20210718/php路线.png
  27. 4 2
      MyBlog/static/account/login.css
  28. 3 0
      MyBlog/static/article/detail.css
  29. 7 0
      MyBlog/static/userprofile/login.css
  30. 7 0
      MyBlog/static/userprofile/register.css
  31. 11 7
      MyBlog/templates/account/login.html
  32. 72 0
      MyBlog/templates/account/signup.html
  33. 100 100
      MyBlog/templates/article/detail.html
  34. 6 6
      MyBlog/templates/header.html
  35. 5 2
      MyBlog/templates/userprofile/login.html
  36. 11 5
      MyBlog/templates/userprofile/register.html
  37. 1 1
      MyBlog/userprofile/migrations/0001_initial.py

+ 8 - 0
MyBlog/.idea/.gitignore

@@ -0,0 +1,8 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml
+# 数据源本地存储已忽略文件
+/dataSources/
+/dataSources.local.xml
+# 基于编辑器的 HTTP 客户端请求
+/httpRequests/

+ 28 - 0
MyBlog/.idea/MyBlog.iml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="FacetManager">
+    <facet type="django" name="Django">
+      <configuration>
+        <option name="rootFolder" value="$MODULE_DIR$" />
+        <option name="settingsModule" value="MyBlog/settings.py" />
+        <option name="manageScript" value="$MODULE_DIR$/manage.py" />
+        <option name="environment" value="&lt;map/&gt;" />
+        <option name="doNotUseTestRunner" value="false" />
+        <option name="trackFilePattern" value="migrations" />
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+  <component name="TemplatesService">
+    <option name="TEMPLATE_CONFIGURATION" value="Django" />
+    <option name="TEMPLATE_FOLDERS">
+      <list>
+        <option value="$MODULE_DIR$/notice/templates" />
+      </list>
+    </option>
+  </component>
+</module>

+ 17 - 0
MyBlog/.idea/inspectionProfiles/Project_Default.xml

@@ -0,0 +1,17 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="ourVersions">
+        <value>
+          <list size="4">
+            <item index="0" class="java.lang.String" itemvalue="2.7" />
+            <item index="1" class="java.lang.String" itemvalue="3.7" />
+            <item index="2" class="java.lang.String" itemvalue="3.8" />
+            <item index="3" class="java.lang.String" itemvalue="3.9" />
+          </list>
+        </value>
+      </option>
+    </inspection_tool>
+  </profile>
+</component>

+ 6 - 0
MyBlog/.idea/inspectionProfiles/profiles_settings.xml

@@ -0,0 +1,6 @@
+<component name="InspectionProjectProfileManager">
+  <settings>
+    <option name="USE_PROJECT_PROFILE" value="false" />
+    <version value="1.0" />
+  </settings>
+</component>

+ 4 - 0
MyBlog/.idea/misc.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8" project-jdk-type="Python SDK" />
+</project>

+ 8 - 0
MyBlog/.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/MyBlog.iml" filepath="$PROJECT_DIR$/.idea/MyBlog.iml" />
+    </modules>
+  </component>
+</project>

+ 6 - 0
MyBlog/.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
+  </component>
+</project>

+ 21 - 1
MyBlog/MyBlog/settings.py

@@ -24,7 +24,7 @@ SECRET_KEY = '+b9j*+2q8py+20_#8tntnkoxz21t5wl&5m6d)zjcvovb6p@(&9'
 # SECURITY WARNING: don't run with debug turned on in production!
 DEBUG = True
 
-ALLOWED_HOSTS = []
+ALLOWED_HOSTS = ['*']
 
 # Application definition
 
@@ -189,5 +189,25 @@ AUTHENTICATION_BACKENDS = (
 # 设置站点
 SITE_ID = 1
 
+# ALLAUTH配置
+ACCOUNT_AUTHENTICATION_METHOD = "username_email"
+
+ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 3
+
+ACCOUNT_EMAIL_VERIFICATION = "optional"
+
+ACCOUNT_EMAIL_CONFIRMATION_COOLDOWN = 180
+
+ACCOUNT_LOGIN_ATTEMPTS_LIMIT = 5
+
+ACCOUNT_LOGIN_ATTEMPTS_TIMEOUT = 300
+
+ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE = True
+
+ACCOUNT_SIGNUP_PASSWORD_ENTER_TWICE = True
+
+ACCOUNT_UNIQUE_EMAIL = True
+
+ACCOUNT_LOGOUT_REDIRECT_URL = '/'
 # 登录成功后重定向地址
 LOGIN_REDIRECT_URL = '/'

+ 3 - 2
MyBlog/article/migrations/0001_initial.py

@@ -1,4 +1,4 @@
-# Generated by Django 3.1.1 on 2021-03-07 01:28
+# Generated by Django 3.2.5 on 2021-07-18 10:57
 
 from django.conf import settings
 from django.db import migrations, models
@@ -12,8 +12,8 @@ class Migration(migrations.Migration):
     initial = True
 
     dependencies = [
-        ('taggit', '0003_taggeditem_add_unique_index'),
         migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+        ('taggit', '0003_taggeditem_add_unique_index'),
     ]
 
     operations = [
@@ -30,6 +30,7 @@ class Migration(migrations.Migration):
             fields=[
                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                 ('title', models.CharField(max_length=100)),
+                ('summary', models.CharField(max_length=100)),
                 ('body', models.TextField()),
                 ('created', models.DateTimeField(default=django.utils.timezone.now)),
                 ('updated', models.DateTimeField(default=django.utils.timezone.now)),

+ 0 - 20
MyBlog/article/migrations/0002_articlepost_summary.py

@@ -1,20 +0,0 @@
-# Generated by Django 3.1.1 on 2021-03-09 04:18
-
-from django.db import migrations, models
-import django.utils.timezone
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('article', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='articlepost',
-            name='summary',
-            field=models.CharField(default=django.utils.timezone.now, max_length=100),
-            preserve_default=False,
-        ),
-    ]

+ 1 - 1
MyBlog/comment/migrations/0001_initial.py

@@ -1,4 +1,4 @@
-# Generated by Django 3.1.1 on 2021-03-07 01:28
+# Generated by Django 3.2.5 on 2021-07-18 10:57
 
 import ckeditor.fields
 from django.conf import settings

BIN
MyBlog/db.sqlite3


BIN
MyBlog/media/article/20210307/01q7x3.jpg


BIN
MyBlog/media/article/20210307/1f441673b2957690f67ff121081d11f6.jpg


BIN
MyBlog/media/article/20210307/4bdc01d290838558dfaea5f390b28712.jpg


BIN
MyBlog/media/article/20210307/4dd37m.jpg


BIN
MyBlog/media/article/20210307/737934.jpg


BIN
MyBlog/media/article/20210307/php路线.png


BIN
MyBlog/media/article/20210307/技术树.png


BIN
MyBlog/media/article/20210308/392zpd.jpg


BIN
MyBlog/media/article/20210308/4769624e404775ab1f8e0ccdacb73671.jpg


BIN
MyBlog/media/article/20210309/4a91ad8e67b2c92de2418e5913767a47.jpg


BIN
MyBlog/media/article/20210718/16210519961.jpg


BIN
MyBlog/media/article/20210718/81aemvs0uhb11.png


BIN
MyBlog/media/article/20210718/81aemvs0uhb11_XcMBN4l.png


BIN
MyBlog/media/article/20210718/php路线.png


+ 4 - 2
MyBlog/static/account/login.css

@@ -1,5 +1,7 @@
-.col-center-block {
+.col-account-login {
     float: none;
     display: block;
-    margin: auto;
+    margin-left: auto;
+    margin-right: auto;
+    margin-top: 50px;
 }

+ 3 - 0
MyBlog/static/article/detail.css

@@ -17,4 +17,7 @@ a {
 }
 .text-slider-items {
     display: none !important;
+}
+img{
+    max-width: 100%!important;
 }

+ 7 - 0
MyBlog/static/userprofile/login.css

@@ -0,0 +1,7 @@
+.col-login {
+    flex: 0 0 50%;
+    max-width: 50%;
+    margin-top: 80px;
+    margin-left: auto;
+    margin-right: auto;
+}

+ 7 - 0
MyBlog/static/userprofile/register.css

@@ -0,0 +1,7 @@
+.col-register {
+    flex: 0 0 50%;
+    max-width: 50%;
+    margin-top: 80px;
+    margin-left: auto;
+    margin-right: auto;
+}

+ 11 - 7
MyBlog/templates/account/login.html

@@ -2,7 +2,7 @@
 {% load static %}
 {% load i18n %}
 {% load account socialaccount %}
-{% block title %}登录{% endblock %}
+{% block title %}登录账号{% endblock %}
 {% block style %}
     <link rel="stylesheet" type="text/css" href="{% static 'L_header.css' %}">
     <link rel="stylesheet" type="text/css" href="{% static 'account/login.css' %}">
@@ -10,7 +10,11 @@
 {% block content %}
     <div class="container mt-5">
         <div class="row">
-            <div class="col-10 col-center-block">
+            <div class="col-10" style=" float: none;
+                                        display: block;
+                                        margin-left: auto;
+                                        margin-right: auto;
+                                        margin-top: 50px;">
                 <br>
                 {% get_providers as socialaccount_providers %}
                 {% if socialaccount_providers %}
@@ -20,10 +24,10 @@
                     </p>
 
                     <div class="socialaccount_ballot">
-                        <h5 class="mb-2 mt-4">第三方登录:</h5>
-                        <ul class="socialaccount_providers">
-                            {% include "socialaccount/snippets/provider_list.html" with process="login" %}
-                        </ul>
+                        <h5 class="mb-2 mt-4">第三方登录:暂无</h5>
+{#                        <ul class="socialaccount_providers">#}
+{#                            {% include "socialaccount/snippets/provider_list.html" with process="login" %}#}
+{#                        </ul>#}
                         <h5 class="mb-2 mt-4">本地登录:</h5>
                     </div>
 
@@ -38,7 +42,7 @@
                         {% csrf_token %}
                         <div class="form-group">
                             <label for="id_login">账号: </label>
-                            <input type="text" name="login" placeholder="请输入用户名或Email" autofocus="autofocus" required
+                            <input type="text" name="login" placeholder="请输入用户名" autofocus="autofocus" required
                                    id="id_login" class="form-control"/>
                             <small class="form-text text-muted ml-1">
                                 还没有账号?

+ 72 - 0
MyBlog/templates/account/signup.html

@@ -0,0 +1,72 @@
+{% extends "base.html" %}
+{% load static %}
+{% load i18n %}
+{% load account socialaccount %}
+{% block title %}注册账号{% endblock %}
+{% block style %}
+    <link rel="stylesheet" type="text/css" href="{% static 'L_header.css' %}">
+{% endblock style %}
+
+{% block content %}
+    <div class="container mt-5">
+        <div class="row">
+            <div class="col-10" style=" float: none;
+                                        display: block;
+                                        margin-left: auto;
+                                        margin-right: auto;
+                                        margin-top: 50px;">
+                <br>
+                <p>
+                    {% blocktrans %}已经有账号了? 请 <a href="{{ login_url }}">登录</a>{% endblocktrans %}
+                </p>
+                <div class="col-8">
+                    <form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}">
+                        <div class="form-group">
+                            {% csrf_token %}
+                            <div class="form-group mb-1">
+                                <label for="id_username">
+                                    用户名
+                                </label>
+                                <input type="text" name="username" placeholder="请输入用户名"
+                                       class="form-control" autocomplete="username" minlength="1" maxlength="150"
+                                       required="" id="id_username"/>
+                            </div>
+{#                            <div class="form-group mb-1">#}
+{#                                <label for="id_email">#}
+{#                                    邮箱(选填)#}
+{#                                </label>#}
+{#                                <input type="email" name="email" placeholder="请输入邮箱" autocomplete="email" id="id_email"#}
+{#                                       class="form-control"/>#}
+{#                            </div>#}
+                            <div class="form-group mb-1">
+                                <label for="id_password1">
+                                    输入密码:
+                                </label>
+                                <input type="password" name="password1" placeholder="请输入密码" autocomplete="new-password"
+                                       required="" id="id_password1"
+                                       class="form-control"/>
+                            </div>
+                            <div class="form-group mb-1">
+                                <label for="id_password2">
+                                    确认密码:
+                                </label>
+                                <input type="password" name="password2" placeholder="请再次输入密码"
+                                       required="" id="id_password2"
+                                       class="form-control"/>
+                            </div>
+                            {% if redirect_field_value %}
+                                <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"
+                                       class="form-control"/>
+                            {% endif %}
+                            <button class="primaryAction btn btn-primary" type="submit"
+                                    id="submit_sign_up">{% trans "注册" %} &raquo;
+                            </button>
+                        </div>
+                    </form>
+                </div>
+            </div>
+        </div>
+    </div>
+
+
+{% endblock %}

+ 100 - 100
MyBlog/templates/article/detail.html

@@ -44,7 +44,7 @@
                     {% endif %}
                     &nbsp;&nbsp;浏览:{{ article.total_views }}
                     <form style="display: none"
-                          id="safa_delete"
+                          id="safe_delete"
                           action="{% url 'article:article_safe_delete' article.id %}"
                           method="post"
                     >
@@ -55,109 +55,109 @@
                     </form>
                 </div>
                 <div class="col-12" data-aos="fade-up" data-aos-delay="160">
-                    <p>
+                    <p class="markdown_body">
                         {{ article.body|safe }}
                     </p>
                 </div>
                 <hr data-aos="fade-up" data-aos-delay="160">
-                {% if user.is_authenticated %}
-                    <div data-aos="fade-up" data-aos-delay="140">
-                        <form action="{% url 'comment:post_comment' article.id %}" method="post">
-                            {% csrf_token %}
-                            <div class="form-group">
-                                <label for="body">
-                                    <strong>
-                                        发表评论
-                                    </strong>
-                                </label>
-                                <!--<textarea type="text" class="form-control" id="body" name="body" rows="2"></textarea>-->
-                                <div>
-                                    {{ comment_form.media }}
-                                    {{ comment_form.body }}
-                                </div>
-                            </div>
-                            <button type="submit" class="btn btn-primary">发送</button>
-                        </form>
-                    </div>
-                    <br>
-                {% else %}
-                    <br>
-                    <h5 class="row justify-content-center" data-aos="fade-up" data-aos-delay="140">
-                        请<a href="{% url 'userprofile:login' %}">登录</a>后回复
-                    </h5>
-                    <br>
-                {% endif %}
-                {% load mptt_tags %}
-                <h4 data-aos="fade-up" data-aos-delay="160">共有{{ comments.count }}条评论</h4>
-                <div class="row" data-aos="fade-up" data-aos-delay="180">
-                    <!-- 遍历树形结构 -->
-                    {% recursetree comments %}
-                        <!-- 给 node 取个别名 comment -->
-                        {% with comment=node %}
-                            <div class="{% if comment.reply_to %}
-                                            offset-1 col-11
-                                        {% else %}
-                                            col-12
-                                        {% endif %}">
-                                <hr>
-                                <p>
-                                    <strong style="color: pink">
-                                        {{ comment.user }}
-                                    </strong>
-                                    {% if comment.reply_to %}
-                                        <i class="far fa-arrow-alt-circle-right"
-                                           style="color: cornflowerblue;"
-                                        ></i>
-                                        <strong style="color: pink">
-                                            {{ comment.reply_to }}
-                                        </strong>
-                                    {% endif %}
-                                </p>
-                                <div>{{ comment.body|safe }}</div>
-                                <div>
-                                    <span style="color: gray">
-                                        {{ comment.created|date:"Y-m-d H:i" }}
-                                    </span>
-                                    <!-- 加载 modal 的按钮 -->
-                                    {% if user.is_authenticated %}
-                                        <button type="button"
-                                                class="btn btn-light btn-sm text-muted"
-                                                onclick="load_modal({{ article.id }}, {{ comment.id }})">
-                                            回复
-                                        </button>
-                                    {% else %}
-                                        <a class="btn btn-light btn-sm text-muted"
-                                           href="{% url 'userprofile:login' %}">
-                                            回复
-                                        </a>
-                                    {% endif %}
-                                </div>
-                                <!-- Modal -->
-                                <div class="modal fade"
-                                     id="comment_{{ comment.id }}"
-                                     tabindex="-1"
-                                     role="dialog"
-                                     aria-labelledby="CommentModalCenter"
-                                     aria-hidden="true">
-                                    <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
-                                        <div class="modal-content" style="height: 480px">
-                                            <div class="modal-header">
-                                                <h5 class="modal-title" id="exampleModalCenterTitle">
-                                                    回复 {{ comment.user }}:</h5>
-                                            </div>
-                                            <div class="modal-body" id="modal_body_{{ comment.id }}"></div>
-                                        </div>
-                                    </div>
-                                </div>
-                                {% if not comment.is_leaf_node %}
-                                    <div class="children">
-                                        {{ children }}
-                                    </div>
-                                {% endif %}
-                            </div>
-                        {% endwith %}
-                    {% endrecursetree %}
-                </div>
+{#                {% if user.is_authenticated %}#}
+{#                    <div data-aos="fade-up" data-aos-delay="140">#}
+{#                        <form action="{% url 'comment:post_comment' article.id %}" method="post">#}
+{#                            {% csrf_token %}#}
+{#                            <div class="form-group">#}
+{#                                <label for="body">#}
+{#                                    <strong>#}
+{#                                        发表评论#}
+{#                                    </strong>#}
+{#                                </label>#}
+{#                                <!--<textarea type="text" class="form-control" id="body" name="body" rows="2"></textarea>-->#}
+{#                                <div>#}
+{#                                    {{ comment_form.media }}#}
+{#                                    {{ comment_form.body }}#}
+{#                                </div>#}
+{#                            </div>#}
+{#                            <button type="submit" class="btn btn-primary">发送</button>#}
+{#                        </form>#}
+{#                    </div>#}
+{#                    <br>#}
+{#                {% else %}#}
+{#                    <br>#}
+{#                    <h5 class="row justify-content-center" data-aos="fade-up" data-aos-delay="140">#}
+{#                        请<a href="{% url 'userprofile:login' %}">登录</a>后回复#}
+{#                    </h5>#}
+{#                    <br>#}
+{#                {% endif %}#}
+{#                {% load mptt_tags %}#}
+{#                <h4 data-aos="fade-up" data-aos-delay="160">共有{{ comments.count }}条评论</h4>#}
+{#                <div class="row" data-aos="fade-up" data-aos-delay="180">#}
+{#                    <!-- 遍历树形结构 -->#}
+{#                    {% recursetree comments %}#}
+{#                        <!-- 给 node 取个别名 comment -->#}
+{#                        {% with comment=node %}#}
+{#                            <div class="{% if comment.reply_to %}#}
+{#                                            offset-1 col-11#}
+{#                                        {% else %}#}
+{#                                            col-12#}
+{#                                        {% endif %}">#}
+{#                                <hr>#}
+{#                                <p>#}
+{#                                    <strong style="color: pink">#}
+{#                                        {{ comment.user }}#}
+{#                                    </strong>#}
+{#                                    {% if comment.reply_to %}#}
+{#                                        <i class="far fa-arrow-alt-circle-right"#}
+{#                                           style="color: cornflowerblue;"#}
+{#                                        ></i>#}
+{#                                        <strong style="color: pink">#}
+{#                                            {{ comment.reply_to }}#}
+{#                                        </strong>#}
+{#                                    {% endif %}#}
+{#                                </p>#}
+{#                                <div>{{ comment.body|safe }}</div>#}
+{#                                <div>#}
+{#                                    <span style="color: gray">#}
+{#                                        {{ comment.created|date:"Y-m-d H:i" }}#}
+{#                                    </span>#}
+{#                                    <!-- 加载 modal 的按钮 -->#}
+{#                                    {% if user.is_authenticated %}#}
+{#                                        <button type="button"#}
+{#                                                class="btn btn-light btn-sm text-muted"#}
+{#                                                onclick="load_modal({{ article.id }}, {{ comment.id }})">#}
+{#                                            回复#}
+{#                                        </button>#}
+{#                                    {% else %}#}
+{#                                        <a class="btn btn-light btn-sm text-muted"#}
+{#                                           href="{% url 'userprofile:login' %}">#}
+{#                                            回复#}
+{#                                        </a>#}
+{#                                    {% endif %}#}
+{#                                </div>#}
+{#                                <!-- Modal -->#}
+{#                                <div class="modal fade"#}
+{#                                     id="comment_{{ comment.id }}"#}
+{#                                     tabindex="-1"#}
+{#                                     role="dialog"#}
+{#                                     aria-labelledby="CommentModalCenter"#}
+{#                                     aria-hidden="true">#}
+{#                                    <div class="modal-dialog modal-dialog-centered modal-lg" role="document">#}
+{#                                        <div class="modal-content" style="height: 480px">#}
+{#                                            <div class="modal-header">#}
+{#                                                <h5 class="modal-title" id="exampleModalCenterTitle">#}
+{#                                                    回复 {{ comment.user }}:</h5>#}
+{#                                            </div>#}
+{#                                            <div class="modal-body" id="modal_body_{{ comment.id }}"></div>#}
+{#                                        </div>#}
+{#                                    </div>#}
+{#                                </div>#}
+{#                                {% if not comment.is_leaf_node %}#}
+{#                                    <div class="children">#}
+{#                                        {{ children }}#}
+{#                                    </div>#}
+{#                                {% endif %}#}
+{#                            </div>#}
+{#                        {% endwith %}#}
+{#                    {% endrecursetree %}#}
+{#                </div>#}
             </div>
             {% if toc_flag %}
                 <div class="col-4 mt-5 sidebar" id="sidebar">

+ 6 - 6
MyBlog/templates/header.html

@@ -55,12 +55,12 @@
                         </a>
                         <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                             <!--通知的计数-->
-                            <a class="dropdown-item" href="{% url 'notice:list' %}">Notice
-                                {% if unread_count %}
-                                    <span class="badge badge-danger">{{ unread_count }}</span>
-                                {% endif %}
-                            </a>
-                            <a class="dropdown-item" href="{% url 'userprofile:edit' user.id %}">Profile</a>
+{#                            <a class="dropdown-item" href="{% url 'notice:list' %}">Notice#}
+{#                                {% if unread_count %}#}
+{#                                    <span class="badge badge-danger">{{ unread_count }}</span>#}
+{#                                {% endif %}#}
+{#                            </a>#}
+{#                            <a class="dropdown-item" href="{% url 'userprofile:edit' user.id %}">Profile</a>#}
                             <a class="dropdown-item" href="{% url 'userprofile:logout' %}">Logout</a>
                             <a class="dropdown-item" href="#" onclick="user_delete()">Delete Account</a>
                         </div>

+ 5 - 2
MyBlog/templates/userprofile/login.html

@@ -3,10 +3,13 @@
 {% block title %}
     登录
 {% endblock title %}
+{% block style %}
+    <link rel="stylesheet" type="text/css" href="{% static 'userprofile/login.css' %}">
+{% endblock style %}
 {% block content %}
     <div class="container">
         <div class="row">
-            <div class="col-12">
+            <div class="col-login">
                 <br>
                 <h5>还没有账号?</h5>
                 <h5>
@@ -37,7 +40,7 @@
                     忘记密码了?
                 </h5>
                 <h5>
-                    点击<a href="{% url "password_reset_recover" %}">这里</a>
+                    点击 <a href="{% url "password_reset_recover" %}">这里</a>
                     重置密码
                 </h5>
             </div>

+ 11 - 5
MyBlog/templates/userprofile/register.html

@@ -3,30 +3,36 @@
 {% block title %}
     登录
 {% endblock title %}
+{% block style %}
+    <link rel="stylesheet" type="text/css" href="{% static 'userprofile/register.css' %}">
+{% endblock style %}
 {% block content %}
     <div class="container">
         <div class="row">
-            <div class="col-12">
+            <div class="col-register">
+                <br>
+                <br>
+                <h5>注册加入我们吧!</h5>
                 <br>
                 <form method="post" action=".">
                     {% csrf_token %}
                     <!-- 账号 -->
-                    <div class="form-group col-md-4">
+                    <div class="form-group col-md-12">
                         <label for="username">昵称</label>
                         <input type="text" class="form-control" id="username" name="username" required>
                     </div>
                     <!-- 邮箱 -->
-                    <div class="form-group col-md-4">
+                    <div class="form-group col-md-12">
                         <label for="email">Email</label>
                         <input type="text" class="form-control" id="email" name="email">
                     </div>
                     <!-- 密码 -->
-                    <div class="form-group col-md-4">
+                    <div class="form-group col-md-12">
                         <label for="password">设置密码</label>
                         <input type="password" class="form-control" id="password" name="password" required>
                     </div>
                     <!-- 确认密码 -->
-                    <div class="form-group col-md-4">
+                    <div class="form-group col-md-12">
                         <label for="password2">确认密码</label>
                         <input type="password" class="form-control" id="password2" name="password2" required>
                     </div>

+ 1 - 1
MyBlog/userprofile/migrations/0001_initial.py

@@ -1,4 +1,4 @@
-# Generated by Django 3.1.1 on 2021-03-07 01:25
+# Generated by Django 3.2.5 on 2021-07-18 10:57
 
 from django.conf import settings
 from django.db import migrations, models