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')
|
||||
|
||||
|
||||
@@ -7,12 +7,17 @@
|
||||
<body>
|
||||
<!-- 添加样式使整个页面内容居中显示 -->
|
||||
<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>
|
||||
<p>发布时间:{{ post.publish_date|date:"Y年n月j日 H:i" }}</p>
|
||||
<!-- 将返回首页链接放在发布时间的右侧 -->
|
||||
<div style="display: flex; align-items: center; justify-content: space-between;">
|
||||
<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内容 -->
|
||||
<div>{{ post.get_markdown_content|safe }}</div>
|
||||
<br>
|
||||
<a href="{% url 'index' %}">返回首页</a>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
@@ -5,14 +5,16 @@
|
||||
<title>六桂流芳的com</title>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 添加样式使整个页面内容居中显示 -->
|
||||
<div style="max-width: 800px; margin: 0 auto; padding: 0 20px; text-align: center;">
|
||||
<h1>六桂流芳的com</h1>
|
||||
<!-- 修改样式使页面内容靠左对齐,标题显示在左上角 -->
|
||||
<div style="max-width: 800px; margin: 0 auto; padding: 0 20px; text-align: left;">
|
||||
<h1 style="text-align: left;">六桂流芳的com</h1>
|
||||
<ul style="list-style: none; padding: 0;">
|
||||
{% for post in posts %}
|
||||
<li style="margin: 10px 0; text-align: left;">
|
||||
<a href="{% url 'detail' post.id %}">{{ post.title }}</a> -
|
||||
发布时间:{{ post.publish_date|date:"Y年n月j日 H:i" }}
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<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>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -21,7 +23,4 @@
|
||||
<a href="https://beian.miit.gov.cn/" target="_blank">闽ICP备2023010767号-2</a>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user