Compare commits
4 Commits
010b45c328
...
479f59f0f3
| Author | SHA256 | Date | |
|---|---|---|---|
| 479f59f0f3 | |||
| bbc3fcef08 | |||
| a32cd6aadd | |||
| 8401704aa6 |
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# 默认忽略的文件
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# 基于编辑器的 HTTP 客户端请求
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
30
.idea/blog.iml
generated
Normal file
30
.idea/blog.iml
generated
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?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$/myblog" />
|
||||||
|
<option name="settingsModule" value="myblog/settings.py" />
|
||||||
|
<option name="manageScript" value="$MODULE_DIR$/myblog/manage.py" />
|
||||||
|
<option name="environment" value="<map/>" />
|
||||||
|
<option name="doNotUseTestRunner" value="false" />
|
||||||
|
<option name="trackFilePattern" value="migrations" />
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/myblog" isTestSource="false" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="jdk" jdkName="Python 3.12 (blog) (2)" jdkType="Python SDK" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
<component name="PyDocumentationSettings">
|
||||||
|
<option name="format" value="PLAIN" />
|
||||||
|
<option name="myDocStringFormat" value="Plain" />
|
||||||
|
</component>
|
||||||
|
<component name="TemplatesService">
|
||||||
|
<option name="TEMPLATE_CONFIGURATION" value="Django" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
6
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
6
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<settings>
|
||||||
|
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||||
|
<version value="1.0" />
|
||||||
|
</settings>
|
||||||
|
</component>
|
||||||
7
.idea/misc.xml
generated
Normal file
7
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Black">
|
||||||
|
<option name="sdkName" value="Python 3.12 (blog) (2)" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (blog) (2)" project-jdk-type="Python SDK" />
|
||||||
|
</project>
|
||||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/blog.iml" filepath="$PROJECT_DIR$/.idea/blog.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -11,7 +11,7 @@ class PostAdmin(admin.ModelAdmin):
|
|||||||
}
|
}
|
||||||
|
|
||||||
# 设置列表显示字段
|
# 设置列表显示字段
|
||||||
list_display = ('title', 'publish_date', 'created_at')
|
list_display = ('title', 'publish_date', 'created_at', 'updated_at')
|
||||||
# 设置搜索字段
|
# 设置搜索字段
|
||||||
search_fields = ('title', 'content')
|
search_fields = ('title', 'content')
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,17 @@
|
|||||||
<body>
|
<body>
|
||||||
<!-- 添加样式使整个页面内容居中显示 -->
|
<!-- 添加样式使整个页面内容居中显示 -->
|
||||||
<div style="max-width: 800px; margin: 0 auto; padding: 0 20px;">
|
<div style="max-width: 800px; margin: 0 auto; padding: 0 20px;">
|
||||||
|
<!-- 添加网站标题 -->
|
||||||
|
<h1 style="text-align: left;">六桂流芳的com</h1>
|
||||||
<h1 style="text-align: center;">{{ post.title }}</h1>
|
<h1 style="text-align: center;">{{ post.title }}</h1>
|
||||||
|
<!-- 将返回首页链接放在发布时间的右侧 -->
|
||||||
|
<div style="display: flex; align-items: center; justify-content: space-between;">
|
||||||
<p>发布时间:{{ post.publish_date|date:"Y年n月j日 H:i" }}</p>
|
<p>发布时间:{{ post.publish_date|date:"Y年n月j日 H:i" }}</p>
|
||||||
|
<a href="{% url 'index' %}" style="margin-left: 20px; white-space: nowrap;">返回首页</a>
|
||||||
|
</div>
|
||||||
<!-- 使用get_markdown_content方法渲染Markdown内容 -->
|
<!-- 使用get_markdown_content方法渲染Markdown内容 -->
|
||||||
<div>{{ post.get_markdown_content|safe }}</div>
|
<div>{{ post.get_markdown_content|safe }}</div>
|
||||||
<br>
|
<br>
|
||||||
<a href="{% url 'index' %}">返回首页</a>
|
|
||||||
</div>
|
</div>
|
||||||
<footer style="position: fixed; bottom: 0; width: 100%; text-align: center; font-size: 12px; color: #999; background-color: white; padding: 5px 0;">
|
<footer style="position: fixed; bottom: 0; width: 100%; text-align: center; font-size: 12px; color: #999; background-color: white; padding: 5px 0;">
|
||||||
<a href="https://beian.miit.gov.cn/" target="_blank">闽ICP备2023010767号-2</a>
|
<a href="https://beian.miit.gov.cn/" target="_blank">闽ICP备2023010767号-2</a>
|
||||||
|
|||||||
@@ -5,14 +5,16 @@
|
|||||||
<title>六桂流芳的com</title>
|
<title>六桂流芳的com</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!-- 添加样式使整个页面内容居中显示 -->
|
<!-- 修改样式使页面内容靠左对齐,标题显示在左上角 -->
|
||||||
<div style="max-width: 800px; margin: 0 auto; padding: 0 20px; text-align: center;">
|
<div style="max-width: 800px; margin: 0 auto; padding: 0 20px; text-align: left;">
|
||||||
<h1>六桂流芳的com</h1>
|
<h1 style="text-align: left;">六桂流芳的com</h1>
|
||||||
<ul style="list-style: none; padding: 0;">
|
<ul style="list-style: none; padding: 0;">
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
<li style="margin: 10px 0; text-align: left;">
|
<li style="margin: 10px 0; text-align: left;">
|
||||||
<a href="{% url 'detail' post.id %}">{{ post.title }}</a> -
|
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||||
发布时间:{{ post.publish_date|date:"Y年n月j日 H:i" }}
|
<a href="{% url 'detail' post.id %}">{{ post.title }}</a>
|
||||||
|
<span style="margin-left: 10px; white-space: nowrap;">发布时间:{{ post.publish_date|date:"Y年n月j日 H:i" }}</span>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
@@ -22,6 +24,3 @@
|
|||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user