Django from scratch to build a personal blog | blog items together

Original article addresses: EOSONES blog

This blog Bootstrap front-end framework design, the backend using Python-3.7, based on Django-2.1 set up, using the server Windows Server 2012, IIS through deployment.

How to build a blog from zero

Django is an open source Web framework written in Python, you can use it to quickly build a high-performance website. If you are starting from scratch, without any relevant language foundation, it is recommended first reading w3cschool | Django tutorial to learn the basics Django, if you just only from zero to Python, the project is a good way to get started directly recognized as learning a language, which blog tutorial Dream character will teach you to build a complete personal blog. Django's learning from process to develop and view the source code official documentation habits, 90% of the problems can be solved here. But interbank self is never an easy task, not only inefficient, but also solve the problem of very slow and very small income, limited self-study a language of time and effort, if you do something not result-oriented, how to grasp the depth of interest dictates right between the two must work efficiency is the key to weight problems.

Source Project

Blog address: EOSONES
blog project Source: Github

Project Directory

Amway a first rapid generation of a directory structure in the plug mddir , use is very simple:
by first mounting npm

>> npm install mddir -g  #-g局部安装

cd to the project directory structure you want to generate, run the command directly mddir

>> cd X:\myblog
>> mddir 

Open the names appear under the root directory of directoryList.md project file, which is our folder directory structure.

|-- Myblog #项目工程
   |-- db.sqlite3
   |-- manage.py  #命令行工具,与该 Django 项目进行交互。
   |-- Apps #博客APP功能归纳文件夹
   |   |-- Comment #博客评论系统APP
   |   |   |-- admin.py 
   |   |   |-- apps.py
   |   |   |-- models.py 
   |   |   |-- tests.py 
   |   |   |-- urls.py 
   |   |   |-- views.py 
   |   |   |-- __init__.py
   |   |   |-- migrations 
   |   |   |-- templatetags 
   |   |   |   |-- comment_tags.py
   |   |   |   |-- __init__.py
   |   |   |   |-- __pycache__
   |   |   |-- __pycache__
   |   |-- Myaccount #用户信息APP
   |   |   |-- admin.py
   |   |   |-- apps.py
   |   |   |-- forms.py
   |   |   |-- models.py
   |   |   |-- tests.py
   |   |   |-- urls.py
   |   |   |-- views.py
   |   |   |-- __init__.py
   |   |   |-- migrations
   |   |   |-- templatetags
   |   |   |   |-- User_tags.py
   |   |   |   |-- __init__.py
   |   |   |   |-- __pycache__
   |   |   |-- __pycache__
   |   |-- Storm #博客系统app
   |   |   |-- admin.py #Django提供的后台管理
   |   |   |-- apps.py #配置当前app
   |   |   |-- feeds.py #扩展博客系统的RSS订阅
   |   |   |-- models.py #创建博客系统数据库表
   |   |   |-- sitemaps.py #配置网站地图
   |   |   |-- tests.py #单元测试
   |   |   |-- urls.py #博客系统分配的urls
   |   |   |-- views.py #博客系统业务逻辑代码
   |   |   |-- __init__.py
   |   |   |-- migrations #记录数据库操作记录(自动)
   |   |   |-- templatetags #提供自定义过滤器或模板语言,方便传递数据到前端
   |   |   |   |-- blog_tags.py
   |   |   |   |-- __init__.py
   |   |   |   |-- __pycache__
   |   |   |-- __pycache__
   |-- media #媒体文件夹
   |   |-- avatar #头像上传
   |   |-- editor #编辑器上传的图片
   |-- Middleware #自定义的统计网站在线人数中间件
   |   |-- auth.py
   |   |-- __pycache__
   |-- Myblog #项目的容器(对整个程序进行配置)
   |   |-- settings.py #该 Django 项目的设置/配置
   |   |-- urls.py #该 Django 项目的 URL 声明,一份由 Django 驱动的网站"目录"。
   |   |-- wsgi.py #一个 WSGI 兼容的 Web 服务器的入口,以便运行你的项目。(依靠WSGI规则封装Socket的模块,可配置Python默认或uwsgi模块)
   |   |-- __init__.py #一个空文件,告诉 Python 该目录是一个 Python 包
   |   |-- __pycache__
   |-- static #项目的静态文件夹
   |   |-- admin #上线收集的admin静态文件
   |   |-- css
   |   |-- fonts
   |   |-- images #博客图片地址
   |   |-- js
   |   |-- mdeditor #上线收集的mdeditor编辑器静态文件
   |-- templates #项目模板
       |-- accounts-base.html #用户信息继承页
       |-- article.html #
       |-- articleList.html #
       |-- content-base.html #文章继承页
       |-- eosones.html #主站
       |-- homepage.html #
       |-- project.html #
       |-- sponsor.html #
       |-- account #修改的allauth插件自带模板

Guess you like

Origin www.cnblogs.com/crime/p/11028223.html