update README
This commit is contained in:
parent
2e66cb1063
commit
bd8ca9116b
32
README.md
32
README.md
@ -1,20 +1,20 @@
|
||||
## Django搭建博客
|
||||

|
||||
[](http://www.spiderpy.cn/blog/)
|
||||
[](http://www.spiderpy.cn/blog/)
|
||||
## Django搭建个人博客
|
||||

|
||||
[]()
|
||||
[](http://www.cnblogs.com/wendaobiancheng/)
|
||||
|
||||
使用Django快速搭建博客
|
||||
### 要求
|
||||
* Python: 2.X
|
||||
* Django: 1.10.x
|
||||
* Mysql
|
||||
### 环境
|
||||
* Python: 3.X
|
||||
* Django: 2.0.x
|
||||
* MySQL
|
||||
|
||||
### 示例博客:<http://www.spiderpy.cn/blog>
|
||||
### 示例博客:<http://www.mylanbitou.top>
|
||||
|
||||
### 特点
|
||||
|
||||
* 博客文章 markdown 渲染,代码高亮
|
||||
* 三方社会化评论系统支持(畅言)
|
||||
* 博客文章 `markdown` 渲染,代码高亮
|
||||
* 第三方社会化评论系统支持(畅言)
|
||||
* 三种皮肤自由切换
|
||||
* 阅读排行榜/最新评论
|
||||
* 多目标源博文分享
|
||||
@ -23,9 +23,7 @@
|
||||
|
||||
### 下载
|
||||
```
|
||||
wget https://github.com/jhao104/django-blog/archive/master.zip
|
||||
or
|
||||
git clone git@github.com:jhao104/django-blog.git
|
||||
git clone https://github.com/myminwang/myblog.git
|
||||
```
|
||||
|
||||
### 安装
|
||||
@ -33,7 +31,7 @@ git clone git@github.com:jhao104/django-blog.git
|
||||
pip install -r requirements.txt #安装所有依赖
|
||||
setting.py配置自己的数据库
|
||||
配置畅言:到http://changyan.kuaizhan.com/注册站点,将templates/message.html中js部分换成你在畅言中生成的js。
|
||||
python manage.py makemigrations blog
|
||||
python manage.py makemigrations
|
||||
python manage.py migrate
|
||||
python manage.py runserver
|
||||
```
|
||||
@ -50,7 +48,3 @@ python manage.py runserver
|
||||
|
||||
* 文章内容
|
||||

|
||||
|
||||
## 历史版本
|
||||
|
||||
* [黑白简约版](https://github.com/jhao104/django-blog/tree/v1.0)
|
||||
|
||||
Binary file not shown.
@ -188,3 +188,25 @@ class Tagcloud(View):
|
||||
'comment_list': comment_list,
|
||||
'count': count,
|
||||
})
|
||||
|
||||
|
||||
def page_not_look(request):
|
||||
"""全局403配置"""
|
||||
from django.shortcuts import render_to_response
|
||||
response = render_to_response('403.html',{})
|
||||
response.status_code = 403
|
||||
return response
|
||||
|
||||
def page_not_found(request):
|
||||
"""全局404配置"""
|
||||
from django.shortcuts import render_to_response
|
||||
response = render_to_response('404.html',{})
|
||||
response.status_code = 404
|
||||
return response
|
||||
|
||||
def page_error(request):
|
||||
"""全局500配置"""
|
||||
from django.shortcuts import render_to_response
|
||||
response = render_to_response('500.html',{})
|
||||
response.status_code = 500
|
||||
return response
|
||||
BIN
doc/image/image1.png
Executable file
BIN
doc/image/image1.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
BIN
doc/image/image2.png
Executable file
BIN
doc/image/image2.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 684 KiB |
BIN
doc/image/image3.png
Executable file
BIN
doc/image/image3.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 MiB |
Binary file not shown.
Binary file not shown.
@ -30,7 +30,7 @@ SECRET_KEY = '%oyd37a)%mh0@zts7b)ki5f1u(ibiw9z%6w9-khmz^gvrd+3&2'
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = []
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
@ -34,3 +34,9 @@ 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}))
|
||||
|
||||
|
||||
# 全局页面配置
|
||||
handler403 = 'blog.views.page_not_look'
|
||||
handler404 = 'blog.views.page_not_found'
|
||||
handler500 = 'blog.views.page_error'
|
||||
|
||||
BIN
static/images/403.jpeg
Normal file
BIN
static/images/403.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
BIN
static/images/404.jpg
Normal file
BIN
static/images/404.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 120 KiB |
BIN
static/images/500.png
Normal file
BIN
static/images/500.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
10
templates/403.html
Executable file
10
templates/403.html
Executable file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>403</title>
|
||||
</head>
|
||||
<body >
|
||||
<img src="../static/images/403.jpeg" alt="">
|
||||
</body>
|
||||
</html>
|
||||
10
templates/404.html
Executable file
10
templates/404.html
Executable file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>404</title>
|
||||
</head>
|
||||
<body >
|
||||
<img src="../static/images/404.jpg" alt="">
|
||||
</body>
|
||||
</html>
|
||||
10
templates/500.html
Normal file
10
templates/500.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>500</title>
|
||||
</head>
|
||||
<body >
|
||||
<img src="../static/images/500.png" alt="">
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user