DEMO
This commit is contained in:
parent
83ec3a3d59
commit
0eb8fc3169
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
blog/__pycache__/urls.cpython-36.pyc
Normal file
BIN
blog/__pycache__/urls.cpython-36.pyc
Normal file
Binary file not shown.
Binary file not shown.
@ -7,11 +7,10 @@ import xadmin
|
||||
from xadmin import views
|
||||
from xadmin.plugins.auth import UserAdmin
|
||||
|
||||
from .models import Blog, Conment, User
|
||||
from .models import Blog, Conment, Category, Tagprofile, Message
|
||||
|
||||
|
||||
|
||||
class BaseSetting(object):
|
||||
class BaseSetting:
|
||||
"""
|
||||
后台修改需要的配置
|
||||
"""
|
||||
@ -19,7 +18,7 @@ class BaseSetting(object):
|
||||
use_bootswatch = True
|
||||
|
||||
|
||||
class GlobalSettings(object):
|
||||
class GlobalSettings:
|
||||
"""
|
||||
后台修改
|
||||
"""
|
||||
@ -27,20 +26,30 @@ class GlobalSettings(object):
|
||||
site_footer = '博客后台管理'
|
||||
menu_style = 'accordion' # 开启分组折叠
|
||||
|
||||
|
||||
class BlogAdmin(object):
|
||||
list_display = ['name', 'content', 'add_time', 'click_nums']
|
||||
list_filter = ['name', 'content', 'click_nums']
|
||||
search_fields = ['name', 'content', 'add_time', 'click_nums']
|
||||
class BlogAdmin:
|
||||
list_display = ['title', 'category', 'author','add_time', 'read_nums', 'conment_nums', 'tag']
|
||||
list_filter = ['title', 'category', 'author','read_nums', 'conment_nums', 'tag']
|
||||
search_fields = ['title', 'category', 'author','add_time', 'read_nums', 'conment_nums', 'tag']
|
||||
readonly_fields = ['add_time', 'read_nums', 'conment_nums','edit_time']
|
||||
|
||||
|
||||
class ConmentAdmin(object):
|
||||
list_display = ['user', 'conment', 'add_time']
|
||||
list_filter = ['user', 'conment']
|
||||
search_fields = ['user', 'conment', 'add_time']
|
||||
class ConmentAdmin:
|
||||
pass
|
||||
|
||||
# xadmin.site.register(User,UsersAdmin)
|
||||
xadmin.site.register(Blog, BlogAdmin)
|
||||
xadmin.site.register(Conment, ConmentAdmin)
|
||||
xadmin.site.register(views.BaseAdminView, BaseSetting)
|
||||
xadmin.site.register(views.CommAdminView, GlobalSettings)
|
||||
class CategoryAdmin:
|
||||
pass
|
||||
|
||||
class TagAdmin:
|
||||
pass
|
||||
|
||||
class MessageAdmin:
|
||||
pass
|
||||
|
||||
|
||||
xadmin.site.register(views.BaseAdminView,BaseSetting)
|
||||
xadmin.site.register(views.CommAdminView,GlobalSettings)
|
||||
xadmin.site.register(Blog,BlogAdmin)
|
||||
xadmin.site.register(Conment,ConmentAdmin)
|
||||
xadmin.site.register(Category,CategoryAdmin)
|
||||
xadmin.site.register(Tagprofile,TagAdmin)
|
||||
xadmin.site.register(Message,MessageAdmin)
|
||||
107
blog/migrations/0002_auto_20180704_0714.py
Normal file
107
blog/migrations/0002_auto_20180704_0714.py
Normal file
@ -0,0 +1,107 @@
|
||||
# Generated by Django 2.0.7 on 2018-07-04 07:14
|
||||
|
||||
import datetime
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('blog', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Category',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=20, verbose_name='文档分类')),
|
||||
('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='创建时间')),
|
||||
('edit_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='修改时间')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '文档分类',
|
||||
'verbose_name_plural': '文档分类',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Message',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('message', models.TextField(verbose_name='留言')),
|
||||
('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='时间')),
|
||||
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='用户')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '留言',
|
||||
'verbose_name_plural': '留言',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Tag',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('tag_name', models.CharField(max_length=30, verbose_name='标签名')),
|
||||
],
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='blog',
|
||||
name='click_nums',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='blog',
|
||||
name='name',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='blog',
|
||||
name='author',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='作者'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='blog',
|
||||
name='conment_nums',
|
||||
field=models.IntegerField(default=0, verbose_name='评论数'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='blog',
|
||||
name='digest',
|
||||
field=models.TextField(default='', verbose_name='摘要'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='blog',
|
||||
name='edit_time',
|
||||
field=models.DateTimeField(default=datetime.datetime.now, verbose_name='更新时间'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='blog',
|
||||
name='read_nums',
|
||||
field=models.IntegerField(default=0, verbose_name='阅读数'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='blog',
|
||||
name='title',
|
||||
field=models.CharField(default='', max_length=50, verbose_name='博客文章'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='conment',
|
||||
name='blog',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='blog.Blog', verbose_name='博客'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='blog',
|
||||
name='add_time',
|
||||
field=models.DateTimeField(default=datetime.datetime.now, verbose_name='创建时间'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='blog',
|
||||
name='category',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='blog.Category', verbose_name='文章分类'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='blog',
|
||||
name='tag',
|
||||
field=models.ManyToManyField(to='blog.Tag'),
|
||||
),
|
||||
]
|
||||
42
blog/migrations/0003_auto_20180704_1744.py
Normal file
42
blog/migrations/0003_auto_20180704_1744.py
Normal file
@ -0,0 +1,42 @@
|
||||
# Generated by Django 2.0.7 on 2018-07-04 17:44
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('blog', '0002_auto_20180704_0714'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='conment',
|
||||
name='blog',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='conment',
|
||||
name='source_id',
|
||||
field=models.CharField(default='1', max_length=25, verbose_name='文章id或source名称'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='conment',
|
||||
name='title',
|
||||
field=models.CharField(default='', max_length=100, verbose_name='标题'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='conment',
|
||||
name='url',
|
||||
field=models.CharField(default='', max_length=100, verbose_name='链接'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='blog',
|
||||
name='image',
|
||||
field=models.ImageField(upload_to='blog/%Y/%m', verbose_name='博客封面'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='conment',
|
||||
name='user',
|
||||
field=models.CharField(max_length=25, verbose_name='评论用户'),
|
||||
),
|
||||
]
|
||||
28
blog/migrations/0004_auto_20180704_1745.py
Normal file
28
blog/migrations/0004_auto_20180704_1745.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Generated by Django 2.0.7 on 2018-07-04 17:45
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('blog', '0003_auto_20180704_1744'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='conment',
|
||||
name='source_id',
|
||||
field=models.CharField(max_length=25, verbose_name='文章id或source名称'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='conment',
|
||||
name='title',
|
||||
field=models.CharField(max_length=100, verbose_name='标题'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='conment',
|
||||
name='url',
|
||||
field=models.CharField(max_length=100, verbose_name='链接'),
|
||||
),
|
||||
]
|
||||
17
blog/migrations/0005_auto_20180704_1756.py
Normal file
17
blog/migrations/0005_auto_20180704_1756.py
Normal file
@ -0,0 +1,17 @@
|
||||
# Generated by Django 2.0.7 on 2018-07-04 17:56
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('blog', '0004_auto_20180704_1745'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='tag',
|
||||
options={'verbose_name': '标签名', 'verbose_name_plural': '标签名'},
|
||||
),
|
||||
]
|
||||
17
blog/migrations/0006_auto_20180704_1759.py
Normal file
17
blog/migrations/0006_auto_20180704_1759.py
Normal file
@ -0,0 +1,17 @@
|
||||
# Generated by Django 2.0.7 on 2018-07-04 17:59
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('blog', '0005_auto_20180704_1756'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameModel(
|
||||
old_name='Tag',
|
||||
new_name='Tagprofile',
|
||||
),
|
||||
]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -5,11 +5,12 @@ from datetime import datetime
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
|
||||
|
||||
# Create your models here.
|
||||
|
||||
class User(AbstractUser):
|
||||
"""用户信息"""
|
||||
class Meta(object):
|
||||
class Meta:
|
||||
verbose_name = '用户信息'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
@ -17,32 +18,81 @@ class User(AbstractUser):
|
||||
return self.username
|
||||
|
||||
|
||||
class Blog(models.Model):
|
||||
"""博客"""
|
||||
name = models.CharField(verbose_name='博客', max_length=50)
|
||||
content = models.TextField(verbose_name='内容')
|
||||
add_time = models.DateTimeField(verbose_name='添加时间',default=datetime.now)
|
||||
click_nums = models.IntegerField(verbose_name='点击数', default=0)
|
||||
image = models.ImageField(verbose_name='博客封面', upload_to='media/blog/%Y/%m')
|
||||
class Category(models.Model):
|
||||
"""博客分类"""
|
||||
name = models.CharField(verbose_name='文档分类',max_length=20)
|
||||
add_time = models.DateTimeField(verbose_name='创建时间',default=datetime.now)
|
||||
edit_time = models.DateTimeField(verbose_name='修改时间',default=datetime.now)
|
||||
|
||||
class Meta(object):
|
||||
verbose_name = '博客信息'
|
||||
class Meta:
|
||||
verbose_name = '文档分类'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class Tagprofile(models.Model):
|
||||
tag_name = models.CharField('标签名', max_length=30)
|
||||
|
||||
class Meta:
|
||||
verbose_name = '标签名'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return self.tag_name
|
||||
|
||||
|
||||
class Blog(models.Model):
|
||||
"""博客文章"""
|
||||
title = models.CharField(verbose_name='博客文章', max_length=50,default='')
|
||||
category = models.ForeignKey(Category,on_delete=models.CASCADE,null=True,verbose_name='文章分类')
|
||||
author = models.ForeignKey(User,on_delete=models.CASCADE,null=True,verbose_name='作者')
|
||||
content = models.TextField(verbose_name='内容')
|
||||
digest = models.TextField(verbose_name='摘要',default='')
|
||||
add_time = models.DateTimeField(verbose_name='创建时间',default=datetime.now)
|
||||
edit_time = models.DateTimeField(verbose_name='更新时间',default=datetime.now)
|
||||
read_nums = models.IntegerField(verbose_name='阅读数', default=0)
|
||||
conment_nums = models.IntegerField(verbose_name='评论数', default=0)
|
||||
image = models.ImageField(verbose_name='博客封面', upload_to='blog/%Y/%m')
|
||||
tag = models.ManyToManyField(Tagprofile)
|
||||
|
||||
|
||||
class Meta:
|
||||
verbose_name = '博客信息'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
|
||||
class Conment(models.Model):
|
||||
user = models.ForeignKey(User,on_delete=models.CASCADE,null=True,verbose_name='用户')
|
||||
"""对博客评论"""
|
||||
user = models.CharField(verbose_name='评论用户', max_length=25)
|
||||
title = models.CharField(verbose_name="标题", max_length=100)
|
||||
source_id = models.CharField(verbose_name='文章id或source名称', max_length=25)
|
||||
conment = models.TextField(verbose_name='评论内容')
|
||||
add_time = models.DateTimeField(verbose_name='添加时间',default=datetime.now)
|
||||
url = models.CharField(verbose_name='链接', max_length=100)
|
||||
|
||||
class Meta(object):
|
||||
class Meta:
|
||||
verbose_name = '评论信息'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return self.user
|
||||
return self.title
|
||||
|
||||
|
||||
|
||||
class Message(models.Model):
|
||||
"""留言"""
|
||||
user = models.ForeignKey(User,on_delete=models.CASCADE,null=True,verbose_name='用户')
|
||||
message = models.TextField(verbose_name='留言')
|
||||
add_time = models.DateTimeField(verbose_name='时间',default=datetime.now)
|
||||
|
||||
class Meta:
|
||||
verbose_name = '留言'
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return self.message
|
||||
|
||||
21
blog/templatetags/__init__.py
Executable file
21
blog/templatetags/__init__.py
Executable file
@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
-------------------------------------------------
|
||||
File Name: __init__.py
|
||||
Description :
|
||||
Author : JHao
|
||||
date: 2017/4/14
|
||||
-------------------------------------------------
|
||||
Change Activity:
|
||||
2017/4/14:
|
||||
-------------------------------------------------
|
||||
"""
|
||||
__author__ = 'JHao'
|
||||
|
||||
import sys
|
||||
|
||||
# reload(sys)
|
||||
# sys.setdefaultencoding('utf-8')
|
||||
|
||||
if __name__ == '__main__':
|
||||
pass
|
||||
BIN
blog/templatetags/__pycache__/__init__.cpython-36.pyc
Normal file
BIN
blog/templatetags/__pycache__/__init__.cpython-36.pyc
Normal file
Binary file not shown.
BIN
blog/templatetags/__pycache__/custom_filter.cpython-36.pyc
Normal file
BIN
blog/templatetags/__pycache__/custom_filter.cpython-36.pyc
Normal file
Binary file not shown.
100
blog/templatetags/custom_filter.py
Executable file
100
blog/templatetags/custom_filter.py
Executable file
@ -0,0 +1,100 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
-------------------------------------------------
|
||||
File Name: custom_filter.py
|
||||
Description :
|
||||
Author : JHao
|
||||
date: 2017/4/14
|
||||
-------------------------------------------------
|
||||
Change Activity:
|
||||
2017/4/14:
|
||||
-------------------------------------------------
|
||||
"""
|
||||
__author__ = 'JHao'
|
||||
|
||||
import re
|
||||
import markdown
|
||||
from django import template
|
||||
from django.template.defaultfilters import stringfilter
|
||||
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
||||
@register.filter
|
||||
def slice_list(value, index):
|
||||
return value[index]
|
||||
|
||||
|
||||
@register.filter(is_safe=True)
|
||||
@stringfilter
|
||||
def custom_markdown(value):
|
||||
content = mark_safe(markdown.markdown(value, extensions=['markdown.extensions.fenced_code',
|
||||
# 'markdown.extensions.codehilite',
|
||||
'markdown.extensions.tables'],
|
||||
safe_mode=True, enable_attributes=False))
|
||||
|
||||
# Prism 代码高亮查件 需要将所有的
|
||||
# markdown转换的代码:<pre><code class="python">import *** </code></pre>
|
||||
# 转换为
|
||||
# <pre class="line-numbers"><code class="language-python">import *** </code></pre>
|
||||
code_list = re.findall(r'<pre><code class="(.*)">', content, re.M)
|
||||
for code in code_list:
|
||||
content = re.sub(r'<pre><code class="(.*)">',
|
||||
'<pre class="line-numbers"><code class="language-{code}">'.format(code=code.lower()), content,
|
||||
1)
|
||||
content = re.sub(r'<pre>\s?<code>', '<pre class="line-numbers"><code class="language-python">', content)
|
||||
return content
|
||||
|
||||
|
||||
@register.simple_tag(takes_context=True)
|
||||
def paginate(context, object_list, page_count):
|
||||
context['count'] = object_list.count
|
||||
paginator = Paginator(object_list, page_count)
|
||||
page = context['request'].GET.get('page')
|
||||
|
||||
try:
|
||||
object_list = paginator.page(page)
|
||||
context['current_page'] = int(page)
|
||||
|
||||
except PageNotAnInteger:
|
||||
object_list = paginator.page(1)
|
||||
context['current_page'] = 1
|
||||
except EmptyPage:
|
||||
object_list = paginator.page(paginator.num_pages)
|
||||
context['current_page'] = paginator.num_pages
|
||||
|
||||
context['article_list'] = object_list
|
||||
context['last_page'] = paginator.num_pages
|
||||
context['first_page'] = 1
|
||||
return '' # 必须加这个,否则首页会显示个None
|
||||
|
||||
|
||||
@register.filter
|
||||
def tag2string(value):
|
||||
"""
|
||||
将Tag转换成string >'python,爬虫'
|
||||
:param value:
|
||||
:return:
|
||||
"""
|
||||
return ','.join([each.get('tag_name', '') for each in value])
|
||||
|
||||
|
||||
@register.filter
|
||||
def getTag(value):
|
||||
"""
|
||||
展示一个tag
|
||||
:param value:
|
||||
:return:
|
||||
"""
|
||||
tag = ''
|
||||
for each in value:
|
||||
if each.get('tag_name'):
|
||||
tag = each.get("tag_name")
|
||||
break
|
||||
return tag
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pass
|
||||
22
blog/urls.py
Normal file
22
blog/urls.py
Normal file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
__author__ = "问道编程"
|
||||
__date__ = "2018-07-04 14:45"
|
||||
|
||||
from django.urls import path
|
||||
|
||||
from .views import *
|
||||
|
||||
urlpatterns = [
|
||||
path('index/', Index.as_view(), name='index'),
|
||||
path('about/', About.as_view(), name='about'),
|
||||
path('archive/', Archive.as_view(), name='archive'),
|
||||
path('link/', Link.as_view(), name='link'),
|
||||
path('message', Message.as_view(), name='message'),
|
||||
path('article/<int:pk>/', Articles.as_view(), name='article'),
|
||||
path('get_comment/', GetComment, name='get_comment'),
|
||||
path('detail/<int:pk>/', Detail.as_view(), name='detail'),
|
||||
path('search/', Search.as_view(), name='search'),
|
||||
path('tag/<int:id>/', Tagcloud.as_view(), name='tag'),
|
||||
|
||||
]
|
||||
185
blog/views.py
185
blog/views.py
@ -1,11 +1,190 @@
|
||||
# _*_ coding:utf-8 _*_
|
||||
from django.shortcuts import render
|
||||
import json
|
||||
|
||||
from django.http import JsonResponse
|
||||
from django.shortcuts import render, get_object_or_404
|
||||
from django.views.generic import View
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from django.db.models import Q
|
||||
|
||||
# Create your views here.
|
||||
|
||||
from .models import Blog, Category, Conment, Tagprofile
|
||||
|
||||
# 通用模块
|
||||
tag_list = Tagprofile.objects.all() # 标签云
|
||||
category_list = Category.objects.all() # 分类
|
||||
article_rank = Blog.objects.all().order_by('-conment_nums')[:10] # 热门博客
|
||||
comment_list = Conment.objects.all().order_by('-add_time')[:20] # 最新评论
|
||||
|
||||
|
||||
class Index(View):
|
||||
"""首页显示"""
|
||||
def get(self,request):
|
||||
|
||||
return render(request,'index.html',{})
|
||||
def get(self, request):
|
||||
article_list = Blog.objects.all().order_by('-edit_time')[:5]
|
||||
article_rank = Blog.objects.all().order_by('-conment_nums')[:5]
|
||||
|
||||
return render(request, 'index.html', {
|
||||
'article_list': article_list,
|
||||
'article_rank': article_rank,
|
||||
'category_list': category_list,
|
||||
'tag_list': tag_list,
|
||||
'comment_list': comment_list,
|
||||
})
|
||||
|
||||
|
||||
class About(View):
|
||||
"""关于"""
|
||||
|
||||
def get(self, request):
|
||||
return render(request, 'about.html', {
|
||||
'article_rank': article_rank,
|
||||
'category_list': category_list,
|
||||
'tag_list': tag_list,
|
||||
'comment_list': comment_list,
|
||||
})
|
||||
|
||||
|
||||
class Articles(View):
|
||||
"""博客文章"""
|
||||
|
||||
def get(self, request, pk):
|
||||
if pk:
|
||||
category_obj = get_object_or_404(Category, id=pk)
|
||||
category = category_obj.name
|
||||
article_list = Blog.objects.filter(category_id=pk)
|
||||
else: # pk=0时,获取全部列表
|
||||
article_list = Blog.objects.all()
|
||||
category = ''
|
||||
count = article_list.count()
|
||||
|
||||
return render(request, 'articles.html', {
|
||||
'article_list': article_list,
|
||||
'category': category,
|
||||
'count': count,
|
||||
'category_list': category_list,
|
||||
'tag_list': tag_list,
|
||||
'article_rank': article_rank,
|
||||
'comment_list': comment_list,
|
||||
|
||||
})
|
||||
|
||||
|
||||
class Archive(View):
|
||||
"""归档"""
|
||||
|
||||
def get(self, request):
|
||||
article_list = Blog.objects.all().order_by('-edit_time')
|
||||
|
||||
return render(request, 'archive.html', {
|
||||
'article_list': article_list,
|
||||
'category_list': category_list,
|
||||
'tag_list': tag_list,
|
||||
'article_rank': article_rank,
|
||||
'comment_list': comment_list,
|
||||
})
|
||||
|
||||
|
||||
class Link(View):
|
||||
"""链接"""
|
||||
|
||||
def get(self, request):
|
||||
return render(request, 'link.html', {
|
||||
'category_list': category_list,
|
||||
'tag_list': tag_list,
|
||||
'article_rank': article_rank,
|
||||
'comment_list': comment_list,
|
||||
})
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class Message(View):
|
||||
"""留言"""
|
||||
|
||||
def get(self, request):
|
||||
return render(request, 'message_board.html', {
|
||||
'category_list': category_list,
|
||||
'tag_list': tag_list,
|
||||
'article_rank': article_rank,
|
||||
'comment_list': comment_list,
|
||||
})
|
||||
|
||||
|
||||
class Search(View):
|
||||
"""搜索"""
|
||||
def get(self,request):
|
||||
key = request.GET.get('key','')
|
||||
if key:
|
||||
article_list = Blog.objects.filter(Q(title__icontains=key) | Q(content__icontains=key))
|
||||
|
||||
else:
|
||||
article_list = ''
|
||||
count = article_list.count()
|
||||
return render(request,'search.html',{
|
||||
'category_list': category_list,
|
||||
'tag_list': tag_list,
|
||||
'article_rank': article_rank,
|
||||
'comment_list': comment_list,
|
||||
'article_list':article_list,
|
||||
'count':count,
|
||||
'key':key,
|
||||
})
|
||||
|
||||
|
||||
@csrf_exempt
|
||||
def GetComment(request):
|
||||
"""
|
||||
接收畅言的评论回推, post方式回推
|
||||
:param request:
|
||||
:return:
|
||||
"""
|
||||
arg = request.POST
|
||||
data = arg.get('data')
|
||||
data = json.loads(data)
|
||||
title = data.get('title')
|
||||
url = data.get('url')
|
||||
source_id = data.get('sourceid')
|
||||
if source_id not in ['message']:
|
||||
article = Blog.objects.get(id=source_id)
|
||||
article.commenced()
|
||||
comments = data.get('comments')[0]
|
||||
content = comments.get('content')
|
||||
user = comments.get('user').get('nickname')
|
||||
Conment(title=title, source_id=source_id, user=user, url=url, conment=content).save()
|
||||
return JsonResponse({"status": "ok"})
|
||||
|
||||
|
||||
class Detail(View):
|
||||
"""博客详情页"""
|
||||
|
||||
def get(self, request, pk):
|
||||
article = get_object_or_404(Blog, id=pk)
|
||||
return render(request, 'detail.html', {
|
||||
'article': article,
|
||||
'source_id': article.id,
|
||||
'tag_list': tag_list,
|
||||
'category_list': category_list,
|
||||
'article_rank': article_rank,
|
||||
'comment_list': comment_list,
|
||||
|
||||
})
|
||||
|
||||
|
||||
class Tagcloud(View):
|
||||
"""标签云"""
|
||||
|
||||
def get(self, request, id):
|
||||
tag = get_object_or_404(Tagprofile, id=id).tag_name
|
||||
article_list = Blog.objects.filter(tag__tag_name=tag)
|
||||
count = article_list.count()
|
||||
return render(request, 'tag.html', {
|
||||
'tag': tag,
|
||||
'article_list': article_list,
|
||||
'category_list': category_list,
|
||||
'tag_list': tag_list,
|
||||
'article_rank': article_rank,
|
||||
'comment_list': comment_list,
|
||||
'count': count,
|
||||
})
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
media/blog/2018/07/kecheng.jpeg
Normal file
BIN
media/blog/2018/07/kecheng.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
BIN
media/blog/2018/07/kecheng_8q53DC5.jpeg
Normal file
BIN
media/blog/2018/07/kecheng_8q53DC5.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -71,6 +71,7 @@ TEMPLATES = [
|
||||
'django.template.context_processors.request',
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
'django.template.context_processors.media',
|
||||
],
|
||||
},
|
||||
},
|
||||
@ -131,16 +132,9 @@ USE_TZ = False
|
||||
# https://docs.djangoproject.com/en/2.0/howto/static-files/
|
||||
|
||||
STATIC_URL = '/static/'
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
||||
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
|
||||
|
||||
|
||||
# 解决:配置正确,而网页中文件无法加载的问题
|
||||
STATICFILES_DIRS = (
|
||||
('css', os.path.join(STATIC_ROOT, 'css').replace('\\', '/')),
|
||||
('js', os.path.join(STATIC_ROOT, 'js').replace('\\', '/')),
|
||||
('images', os.path.join(STATIC_ROOT, 'images').replace('\\', '/')),
|
||||
)
|
||||
|
||||
|
||||
# 配置用户上传的文件
|
||||
MEDIA_URL = '/media/'
|
||||
|
||||
@ -13,13 +13,24 @@ Including another URLconf
|
||||
1. Import the include() function: from django.urls import include, path
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.conf import settings
|
||||
from django.views.static import serve # 处理静态文件
|
||||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
from django.urls import path,include
|
||||
from django.conf.urls import url
|
||||
import xadmin
|
||||
|
||||
from blog.views import *
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', xadmin.site.urls),
|
||||
|
||||
path('',Index.as_view(),name='index'),
|
||||
path('blog/', include(('blog.urls', 'blog'), namespace='blog')),
|
||||
|
||||
]
|
||||
|
||||
if settings.DEBUG:
|
||||
# 配置静态文件访问处理
|
||||
urlpatterns.append(url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}))
|
||||
urlpatterns.append(url(r'^static/(?P<path>.*)$', serve, {'document_root': settings.STATIC_ROOT}))
|
||||
|
||||
4318
static/js/jquery.min.js
vendored
Executable file
4318
static/js/jquery.min.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
{% extends "blog/base.html" %}
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
<title>AboutMe - 烂笔头</title>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{% extends "blog/base.html" %}
|
||||
{% extends "base.html" %}
|
||||
{% load custom_filter %}
|
||||
|
||||
{% block title %}
|
||||
@ -16,11 +16,11 @@
|
||||
<li class="event">
|
||||
<input type="radio" name="tl-group" {% if forloop.counter0 == 0 %} checked {% endif %}/>
|
||||
<label></label>
|
||||
<div class="thumb"><span>{{ article.date_time }}</span></div>
|
||||
<div class="thumb"><span>{{ article.edit_time }}</span></div>
|
||||
<div class="content-perspective">
|
||||
<div class="content">
|
||||
<div class="content-inner">
|
||||
<h3><a href="{% url "blog:detail" pk=article.id%}">{{ article.title }}</a></h3>
|
||||
<h3><a href="{% url "blog:detail" article.id%}">{{ article.title }}</a></h3>
|
||||
<p>{{ article.digest }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{% extends "blog/base.html" %}
|
||||
{% extends "base.html" %}
|
||||
{% load custom_filter %}
|
||||
|
||||
{% block title %}
|
||||
@ -10,7 +10,7 @@
|
||||
{% if article_list %}
|
||||
<section class="mysection">
|
||||
<h4 class="index-title">
|
||||
<a href="{% url "blog:article" pk=0 %}"><i class="el-th-list"></i>{% if category %}列表{% else %} 全部 {% endif %} > </a>
|
||||
<a href="{% url "blog:article" 0 %}"><i class="el-th-list"></i>{% if category %}列表{% else %} 全部 {% endif %} > </a>
|
||||
<span class="orange-text">{{ category }}</span>
|
||||
<span style="float:right;margin-right:10px;">共有文章:<a class="orange-text"> {{ count }} </a>篇</span>
|
||||
</h4>
|
||||
@ -18,26 +18,26 @@
|
||||
<!--列表开始-->
|
||||
<ul>
|
||||
{% for article in article_list %}
|
||||
<li {% if article.view > 500 %}id="tuijian"{% elif article.view > 100 %} id="Hot" {% endif %}>
|
||||
<li {% if article.read_nums > 500 %}id="tuijian"{% elif article.read_nums > 100 %} id="Hot" {% endif %}>
|
||||
<div class="arcimg">
|
||||
|
||||
<img src="{{ article.picture }}"
|
||||
<img src="{{ MEDIA_URL }}{{ article.image }}"
|
||||
alt="{{ article.title }}" title="{{ article.title }}"/>
|
||||
</div>
|
||||
<div class="arc-right">
|
||||
<h4 class="blue-text"><a href="{% url "blog:detail" pk=article.id %}" title="{{ article.title }}">{{ article.title }}</a></h4>
|
||||
<h4 class="blue-text"><a href="{% url "blog:detail" article.id %}" title="{{ article.title }}">{{ article.title }}</a></h4>
|
||||
<p>{{ article.digest }}</p>
|
||||
<ul>
|
||||
<li><a title="{{ article.author }} {{ article.date_time }} 发表 "><i class="el-time"></i> {{ article.date_time }}</a></li>
|
||||
<li><a title="{{ article.author }} {{ article.edit_time }} 发表 "><i class="el-time"></i> {{ article.edit_time }}</a></li>
|
||||
<li><a href="#" title="作者: {{ article.author }}"><i class="el-user"></i>{{ article.author }}</a></li>
|
||||
<li><a href="#" title="已有 {{ article.comment }} 条评论"><i class="el-comment"></i>{{ article.comment }}</a>
|
||||
<li><a href="#" title="已有 {{ article.conment_nums }} 条评论"><i class="el-comment"></i>{{ article.conment_nums }}</a>
|
||||
</li>
|
||||
<li><a title="已有 {{ article.view }} 次浏览"><i class="el-eye-open"></i>{{ article.view }}</a></li>
|
||||
<li><a title="已有 {{ article.read_nums }} 次浏览"><i class="el-eye-open"></i>{{ article.read_nums }}</a></li>
|
||||
<li class="mob-hidden">
|
||||
<i class="el-tag"></i>
|
||||
<a href="#">{{ article.tag.values| getTag }}</a>
|
||||
</li>
|
||||
<li><a href="{% url "blog:article" pk=article.category_id %}" title="查看分类"><i class="el-th-list"></i>{{ article.category }}</a></li>
|
||||
<li><a href="{% url "blog:article" article.category.id %}" title="查看分类"><i class="el-th-list"></i>{{ article.category.name }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
@ -54,7 +54,6 @@
|
||||
</ul>
|
||||
</div>
|
||||
<ul>
|
||||
|
||||
<li {% if current_page == 1 %}class="active"{% endif %}><a href="?page=1">首页</a></li>
|
||||
<li {% if current_page >= 2 %} {% else %}class="active"{% endif %}><a href="?page={{ current_page|add:-1 }}">上一页</a></li>
|
||||
<li {% if current_page < last_page %} {% else %}class="active"{% endif %}><a href="?page={{ current_page|add:1 }}">下一页</a></li>
|
||||
|
||||
@ -66,14 +66,14 @@
|
||||
|
||||
|
||||
<!--=========右侧开始==========-->
|
||||
{% include "blog/right.html" %}
|
||||
{% include "right.html" %}
|
||||
<!--=========END右侧==========-->
|
||||
</div>
|
||||
<!--主题框架结束-->
|
||||
|
||||
|
||||
<!---底部开始-->
|
||||
{% include "blog/footer.html" %}
|
||||
{% include "footer.html" %}
|
||||
<!---返回顶部-->
|
||||
|
||||
<!---END 底部开始-->
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{% extends "blog/base.html" %}
|
||||
{% extends "base.html" %}
|
||||
{% load custom_filter %}
|
||||
|
||||
{% block title %}
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
{% block meta %}
|
||||
<meta name="keywords"
|
||||
content="{{ article.title }},{% for tag in article.tag.all %}{{ tag }},{% endfor %}{{ article.category }}"/>
|
||||
content="{{ article.title }},{% for tag in article.tag.all %}{{ tag }},{% endfor %}{{ article.category.name }}"/>
|
||||
<meta name="description" content="{{ article.digest|safe }}"/>
|
||||
{% endblock %}
|
||||
|
||||
@ -34,12 +34,12 @@
|
||||
<h3 class="arc-title index-title">{{ article.title }} </h3>
|
||||
<div class="post-line bg-color">
|
||||
<ul>
|
||||
<li><a title="{{ article.author }}发表于{{ article.date_time }}"><i class="el-time"></i>
|
||||
<time>{{ article.date_time }}</time>
|
||||
<li><a title="{{ article.author }}发表于{{ article.edit_time }}"><i class="el-time"></i>
|
||||
<time>{{ article.edit_time }}</time>
|
||||
</a></li>
|
||||
<li><a href="#"><i class="el-user"></i>{{ article.author }}</a></li>
|
||||
<li><a href="#Coon" title="转到评论"><i class="el-comment"></i>{{ article.comment }}条</a></li>
|
||||
<li><a title="已有 {{ article.view }} 次浏览"><i class="el-eye-open"></i>{{ article.view }}</a></li>
|
||||
<li><a href="#Coon" title="转到评论"><i class="el-comment"></i>{{ article.conment_nums }}条</a></li>
|
||||
<li><a title="已有 {{ article.read_nums }} 次浏览"><i class="el-eye-open"></i>{{ article.read_nums }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -92,9 +92,9 @@
|
||||
<div class="article_tag">
|
||||
<ul>
|
||||
<li><a href="{% url "blog:article" pk=article.category_id %}"
|
||||
title="归类:{{ article.category }}">{{ article.category }}</a></li>
|
||||
title="归类:{{ article.category.name }}">{{ article.category.name }}</a></li>
|
||||
{% for tag in article.tag.all %}
|
||||
<li><a href="{% url "blog:tag" name=tag.tag_name %}"
|
||||
<li><a href="{% url "blog:tag" tag.id %}"
|
||||
title="标签:{{ tag.tag_name }} ">{{ tag.tag_name }}</a> </li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@ -107,12 +107,11 @@
|
||||
</article>
|
||||
|
||||
<!--评论表单-->
|
||||
{% include "blog/message.html" %}
|
||||
{% include "message.html" %}
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="https://changyan.itc.cn/js/lib/jquery.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="https://changyan.itc.cn/js/lib/jquery.js"></script>
|
||||
<script type="text/javascript" charset="utf-8"
|
||||
src="https://changyan.sohu.com/js/changyan.labs.https.js?appid=cyt6A5N47"></script>
|
||||
src="https://changyan.sohu.com/js/changyan.labs.https.js?appid=cytzXhLuB"></script>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<footer>
|
||||
<!--底部导航-->
|
||||
<div class="foot-nav">
|
||||
<div class="copy-right"><span>CopyRight © 2015-2016 j_hao104's博客     Design by j_hao104</span></div>
|
||||
<div class="copy-right"><span>CopyRight © 2018-2019 博客     Design by mylanbitou</span></div>
|
||||
<div class="license bottom-nav">
|
||||
<a href="http://www.miitbeian.gov.cn">@2017 spiderpy.cn 蜀ICP备17012574号-1</a></span>
|
||||
<a href="http://www.miitbeian.gov.cn">@2017 spiderpy.cn 京ICP备17012574号-1</a></span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="toTop">Back to Top</div>
|
||||
|
||||
@ -24,13 +24,13 @@
|
||||
<ul class="orange-text">
|
||||
<li class=""><a href="{% url "blog:index" %}">首页</a></li>
|
||||
<li><a href="{% url "blog:about" %}">关于</a></li>
|
||||
<li><a href="{% url "blog:article" pk=0 %}">博客</a></li>
|
||||
<li><a href="{% url "blog:article" 0 %}">博客</a></li>
|
||||
<li class='drop'>
|
||||
<a href="JavaScript:;">分类<i class='el-chevron-down'></i></a>
|
||||
<div class="drop-nav orange-text ">
|
||||
<ul>
|
||||
{% for category in category_list %}
|
||||
<li><a href="{% url "blog:article" pk=category.pk %}">{{ category.name }}</a></li>
|
||||
<li><a href="{% url "blog:article" category.id %}">{{ category.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
@ -62,7 +62,7 @@
|
||||
<a href="javascrip:;">分类</a>
|
||||
<ul class="mob-dropmenu">
|
||||
{% for category in category_list %}
|
||||
<li><a href="{% url "blog:article" pk=category.pk %}">{{ category.name }}</a></li>
|
||||
<li><a href="{% url "blog:article" category.id %}">{{ category.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{% extends "blog/base.html" %}
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
@ -42,22 +42,22 @@
|
||||
{% for article in article_list %}
|
||||
<li id="New">
|
||||
<div class="arcimg">
|
||||
<img src="{{ article.picture }}" alt="{{ article.title }}" title="{{ article.title }}"/>
|
||||
<img src="{{ MEDIA_URL }}{{ article.image }}" alt="{{ article.title }}" title="{{ article.title }}"/>
|
||||
</div>
|
||||
<div class="arc-right">
|
||||
<h4 class="blue-text"><a href="{% url "blog:detail" pk=article.id %}" title="{{ article.title }}">{{ article.title }}</a></h4>
|
||||
<p>{{ article.digest }}</p>
|
||||
<ul>
|
||||
<li><a title="{{ article.author }}{{ article.date_time }} 发表 "><i
|
||||
class="el-time"></i> {{ article.date_time }}</a></li>
|
||||
<li><a title="{{ article.author }} {{ article.edit_time }} 发表 ">
|
||||
<i class="el-time"></i> {{ article.edit_time }}</a></li>
|
||||
<li><a href="#" title="作者: {{ article.author }}"><i
|
||||
class="el-user"></i>{{ article.author }}</a></li>
|
||||
<li><a href="#" title="已有 {{ article.comment }} 条评论"><i
|
||||
class="el-comment"> {{ article.comment }}</i></a>
|
||||
<li><a href="#" title="已有 {{ article.conment_nums }} 条评论"><i
|
||||
class="el-comment"> {{ article.conment_nums }}</i></a>
|
||||
</li>
|
||||
<li><a title="已有 {{ article.view }} 次浏览"><i class="el-eye-open"></i>{{ article.view }}
|
||||
<li><a title="已有 {{ article.read_nums }} 次浏览"><i class="el-eye-open"></i>{{ article.read_nums }}
|
||||
</a></li>
|
||||
<li><a href="#" title="查看分类"><i class="el-th-list"></i>{{ article.category }}</a></li>
|
||||
<li><a href="#" title="查看分类"><i class="el-th-list"></i>{{ article.category.name }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
@ -75,22 +75,23 @@
|
||||
{% for article in article_rank %}
|
||||
<li id="Hot">
|
||||
<div class="arcimg">
|
||||
<img src="{{ article.picture }}" alt="{{ article.title }}" title="{{ article.title }}"/>
|
||||
<img src="{{ MEDIA_URL }}{{ article.image }}" alt="{{ article.title }}" title="{{ article.title }}"/>
|
||||
</div>
|
||||
<div class="arc-right">
|
||||
<h4 class="blue-text"><a href="{% url "blog:detail" pk=article.id %}" title="{{ article.title }}">{{ article.title }}</a></h4>
|
||||
<h4 class="blue-text">
|
||||
<a href="{% url "blog:detail" pk=article.id %}" title="{{ article.title }}">{{ article.title }}</a></h4>
|
||||
<p>{{ article.digest }}</p>
|
||||
<ul>
|
||||
<li><a title="{{ article.author }}{{ article.date_time }} 发表 "><i
|
||||
class="el-time"></i> {{ article.date_time }}</a></li>
|
||||
<li><a title="{{ article.author }}{{ article.edit_time }} 发表 "><i
|
||||
class="el-time"></i> {{ article.edit_time }}</a></li>
|
||||
<li><a href="#" title="作者: {{ article.author }}"><i
|
||||
class="el-user"></i>{{ article.author }}</a></li>
|
||||
<li><a href="#" title="已有 {{ article.comment }} 条评论"><i
|
||||
class="el-comment"> {{ article.comment }}</i></a>
|
||||
<li><a href="#" title="已有 {{ article.conment_nums }} 条评论"><i
|
||||
class="el-comment"> {{ article.conment_nums }}</i></a>
|
||||
</li>
|
||||
<li><a title="已有 {{ article.view }} 次浏览"><i class="el-eye-open"></i>{{ article.view }}
|
||||
<li><a title="已有 {{ article.read_nums }} 次浏览"><i class="el-eye-open"></i>{{ article.read_nums }}
|
||||
</a></li>
|
||||
<li><a href="#" title="查看分类"><i class="el-th-list"></i>{{ article.category }}</a></li>
|
||||
<li><a href="#" title="查看分类"><i class="el-th-list"></i>{{ article.category.name }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{% extends "blog/base.html" %}
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
<title>链接 - 烂笔头 </title>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{% extends "blog/base.html" %}
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
<title>留言板 - 烂笔头</title>
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
<section class="mysection">
|
||||
|
||||
{% include "blog/message.html" %}
|
||||
{% include "message.html" %}
|
||||
</section>
|
||||
|
||||
{% endblock %}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user