# Blog_Django_Project
<HR>
- [Blog_Django_Project](#blog-django-project)
* [Projekt Description](#projekt-description)
* [System Dependency](#system-dependency)
* [Depolyment process](#depolyment-process)
* [Main View](#main-view)
* [Database](#database)
+ [blog_app](#blog-app)
- [Table: Post](#table--post)
- [Table: Tag](#table--tag)
- [Table: Category](#table--category)
+ [blog_comment](#blog-comment)
* [Table: Comment](#table--comment)
* [Usage](#usage)
+ [Login and Register](#login-and-register)
- [Authentication](#authentication)
+ [Blog System](#blog-system)
- [Home Page](#home-page)
- [Post Detail Page and Comment](#post-detail-page-and-comment)
- [Blog List](#blog-list)
- [About me](#about-me)
- [Contact me](#contact-me)
- [Post New](#post-new)
- [Search and Logout](#search-and-logout)
* [Administration System](#administration-system)
* [Static Content and Template](#static-content-and-template)
+ [Template in setting.py](#template-in-settingpy)
+ [Static Content in setting.py](#static-content-in-settingpy)
* [Restful API](#restful-api)
* [Other](#other)
## Projekt Description
Through this Django project we can deploy a personal blog.
It is a pure Django project without frontend and backend separation.
SQLite is used as Database
## System Dependency
Python3, Django and Third Party Dependency ( written in requirements.txt)
## Depolyment process
1. Install the thrid-party Library according to requirements.txt: `pip install -r requirements.txt`
2. run Django Project through execute `python manage.py runserver 8000`
## Main View
- admin
- [admin page](http://127.0.0.1:8000/admin): http://127.0.0.1:8000/admin
- blog_auth
- [login](http://127.0.0.1:8000/auth/login): http://127.0.0.1:8000/auth/login
- [register](http://127.0.0.1:8000/auth/register): http://127.0.0.1:8000/auth/register
- [logout](http://127.0.0.1:8000/auth/logout): http://127.0.0.1:8000/auth/logout, logout the current user and redirect to the login page auotmatically
- blog_app
- [Home Page](http://127.0.0.1:8000/blog/home): http://127.0.0.1:8000/blog/home
- [Blog List](http://127.0.0.1:8000/blog/full): http://127.0.0.1:8000/blog/full
- [About me](http://127.0.0.1:8000/blog/about/): http://127.0.0.1:8000/blog/about/
- [Contact me](http://127.0.0.1:8000/blog/contact/): http://127.0.0.1:8000/blog/contact/
- [Post new ](http://127.0.0.1:8000/blog/post/new/): http://127.0.0.1:8000/blog/post/new/
- blog_comment
- [comment](http://127.0.0.1:8000/blog/comment/post/<post_pk>): http://127.0.0.1:8000/blog/comment/post/<post_pk>, show all comments of the post with the post_pk
- blog_api
- [api list](http://127.0.0.1:8000/api/): http://127.0.0.1:8000/api/, show all api
- [posts](http://127.0.0.1:8000/api/posts/): http://127.0.0.1:8000/api/posts/, show all posts
- [categories](http://127.0.0.1:8000/api/categories/): http://127.0.0.1:8000/api/categories/, show all categories
- [tags](http://127.0.0.1:8000/api/tags/): http://127.0.0.1:8000/api/tags/), show all tags
- [users](http://127.0.0.1:8000/api/users/): http://127.0.0.1:8000/api/users/, show all users
View map
![](readme_picture/view_map.png)
## Database
Only in the Application blog_app, blog_comment, the new Data class are registered in the models.py. The tables are created in the database through the migration. The migration is done by the command `python manage.py makemigrations` and `python manage.py migrate`. Once they are executed, the tables are created in the database.
### blog_app
#### Table: Post
The Post in the Blog System
Attributes
- title: title of the post
- body: content of the post
- create_time: create time of the post
- modified_time: modified time of the post
- excerpt: if empty, the first 50 characters of body is used
- views: how many times this post is viewed
- category: As ForeignKey to table Category
- tags: mapping to the name in the table Tag
- author = As ForeignKey to table User
#### Table: Tag
Tag of post
Attributes
- name: name of tag
#### Table: Category
Category of post
Attributes
- name: name of category
### blog_comment
##### Table: Comment
Comment of post
Attributes
- author: ForeignKey to User
- email: email of the author
- url: url of the author
- text: content of the comment
- create_time: create time of the comment
- post: ForeignKey to Post
## Usage
### Login and Register
There are two page: login and register.
In the login mode, you can choose remember me or not. If you choose remember me, the session will be saved for 14 days. Otherwise, the session will expire after the browser is closed.
![](readme_picture/blog_auth/01_login.png)
In the register mode, you need to set the username, the password and the email. The username and the email should be unique. The password should be at least 8 characters long. After you have registered, you will be redirected to the login page. you have to login with the username and the password you have just set.
![](readme_picture/blog_auth/02_register.png)
Moreover, you can also enter to the Home page and The Page for creating new post directly through the main bar. Enter the Home page you don't need to login. But if you want to create a new post, you need to login first. Otherwise, you will be redirected to the login page.
#### Authentication
Once you register a new user through Register page, this new created user will be registered into the Built-in User table of Django. The password of the user is hashed by the Django built-in hash function. The password is not stored in the database directly.
The User below are available in the system. You can login with the username and the password below. Or you can also create a new user through the Register page.
| username | password | email | permission |
|----------|-----------|------------------------|-------------|
| admin | django123 | bigberlin100@gmail.com | superuser |
| Thomas | django123 | bigberlin200@gmail.com | normal user |
| Dylan | django123 | bigberlin300@gmail.com | normal user |
| Jens | django123 | bigberlin400@gmail.com | normal user |
| Florian | django123 | bigberlin500@gmail.com | normal user |
### Blog System
There are five main pages in the blog system: Home Page, Blog List and About me, Contact me and Post new. They are all accessible through the main bar.
The welcome word "Hello, \<Username of current session\>" will be shown in the main bar if you have logged in.
#### Home Page
The Blog are display in the link part of the Home Page. The first 3 posts are shown in the Home Page. You can click the title of the post to see the detail of the post.
The navigation bar is shown in the right side of the Home Page. The option blow are listed in the navigation bar:
- The latest 5 posts
- Archive: The posts are grouped by year
- category: The posts are grouped by category. you can click the category to see the posts in this category
- tag: The posts are grouped by tag. you can click the tag to see the posts in this tag
![](readme_picture/blog_app/01_homePage.png)
#### Post Detail Page and Comment
The detail of the post is shown in the Detail Page of one Post. You can see the title, the author, the create time, the modified time, the category, the tags and the content of the post.
The view number of the post is shown blow the title of the post. The view number will be increased by 1 every time you enter the detail page of the post.
The comments of the post are shown below the post. You can add a comment to the post if you have logged in. The comments are paginated by 10 comments per page. In order to add a comment, you have to login first. Otherwise, you will be redirected to the login page.
![](readme_picture/blog_app/02_BlogDetail.png)
#### Blog List
All Blog are shown in the Blog List. You can click the title of the post to see the detail of the post. The blogs are pa
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Python Django Personal Blog 个人博客系统.zip (862个子文件)
bootstrap.min.css 227KB
bootstrap.min.css 114KB
style.css 15KB
custom.css 14KB
tango.css 4KB
fruity.css 4KB
native.css 4KB
pastie.css 4KB
murphy.css 4KB
colorful.css 4KB
vim.css 4KB
manni.css 4KB
github.css 4KB
default.css 4KB
friendly.css 4KB
emacs.css 4KB
trac.css 4KB
perldoc.css 4KB
monokai.css 4KB
autumn.css 4KB
borland.css 3KB
nord.min.css 3KB
zenburn.css 2KB
bw.css 2KB
vs.css 2KB
grayscale.min.css 2KB
snazzy.min.css 1KB
papercolor-dark.min.css 1KB
papercolor-light.min.css 1KB
dracula.min.css 1KB
rebecca.min.css 1KB
gruvbox-light-medium.min.css 1KB
gruvbox-dark-medium.min.css 1KB
circus.min.css 1KB
gruvbox-light-hard.min.css 1KB
gruvbox-light-soft.min.css 1KB
gruvbox-dark-hard.min.css 1KB
gruvbox-dark-soft.min.css 1KB
gruvbox-dark-pale.min.css 1KB
synth-midnight-terminal-light.min.css 1KB
nova.min.css 1KB
synth-midnight-terminal-dark.min.css 1KB
spacemacs.min.css 1KB
espresso.min.css 1KB
atelier-sulphurpool-light.min.css 1KB
night-owl.min.css 1KB
atelier-lakeside-light.min.css 1KB
oceanicnext.min.css 1KB
atelier-savanna-light.min.css 1KB
atelier-seaside-light.min.css 1KB
atelier-plateau-light.min.css 1KB
atelier-estuary-light.min.css 1KB
outrun-dark.min.css 1KB
atelier-forest-light.min.css 1KB
atelier-sulphurpool.min.css 1KB
atelier-dune-light.min.css 1KB
horizon-light.min.css 1KB
atelier-cave-light.min.css 1KB
windows-95-light.min.css 1KB
horizon-dark.min.css 1KB
harmonic16-light.min.css 1KB
solar-flare-light.min.css 1KB
nnfx-light.min.css 1KB
harmonic16-dark.min.css 1KB
atelier-heath-light.min.css 1KB
grayscale-light.min.css 1KB
brush-trees-dark.min.css 1KB
solarized-light.min.css 1KB
atelier-lakeside.min.css 1KB
dark-violet.min.css 1KB
nnfx-dark.min.css 1KB
atelier-estuary.min.css 1KB
atelier-plateau.min.css 1KB
grayscale-dark.min.css 1KB
windows-10-light.min.css 1KB
solarized-dark.min.css 1KB
atelier-savanna.min.css 1KB
atelier-seaside.min.css 1KB
silk-light.min.css 1KB
one-light.min.css 1KB
atelier-forest.min.css 1KB
porple.min.css 1KB
windows-high-contrast-light.min.css 1KB
windows-high-contrast.min.css 1KB
tender.min.css 1KB
summerfruit-dark.min.css 1KB
xcode-dusk.min.css 1KB
silk-dark.min.css 1KB
atelier-cave.min.css 1KB
danqing.min.css 1KB
atelier-dune.min.css 1KB
marrakesh.min.css 1KB
solar-flare.min.css 1KB
brush-trees.min.css 1KB
brogrammer.min.css 1KB
atelier-heath.min.css 1KB
nebula.min.css 1KB
darkmoss.min.css 1KB
pasque.min.css 1KB
default-light.min.css 1KB
共 862 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
嵌入式大圣
- 粉丝: 2609
- 资源: 715
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功