This is the first day of my participation in Gwen Challenge

Why write this tutorial?

I am a heavy User of Django, and have been using Django since 1.8. Idcops is another Django project of mine, which is now attracting some real business users as well.

I just want to change docspace recently, so the blog tutorial project is still called Docspace.

From Django1.8 to django3.x, so many applications have been developed without any summary.

Who will this tutorial be for?

Some basic knowledge of the Python programming language is required.

Someone who already knows Django (since this is a blog update, this post focuses on feature development and won’t cover much of the basics).

Analysis of blog application requirements

The following is my understanding of the structure of a blog application, and the rest of the tutorial will focus on the following analysis. The development process is not guaranteed to be exactly as required.

Let’s take a look at the requirements analysis of the blog application and why:

First, the composition of the main fields of the blog article

  • Title, this is the most important attribute of a blog post, even if the content of the article is empty, the title or there is no;

  • Article slug title, optional, used primarily above urls;

  • Article content, usually a textfield, is used to store article content;

  • Categories and labels are generally many-to-many, that is, an article can be used for multiple categories or labels at the same time;

  • Release time and update time, social progress has never stopped, and the speed of development is getting faster and faster, the speed of iteration of many things is beyond people’s imagination, therefore, the recorded content may only be suitable for a certain period of time, and at the same time, it is conducive to robot grasping, which is specially done later;

  • The number of comments, views, favorites, etc., are used to measure changes in an article after it is published. It is worth mentioning here that these fields are treated as an attribute of the article because of the ability to retrieve the desired data from the database query at once;

  • Author, this is also very important, who published the article, who owns the copyright, who has the qualification or responsibility to explain relevant questions;

  • The page requirements are basically the same as the article, which will be directly reflected in the Django model later.

Second, the classification of blog posts or tags

  • Label name, not empty, similar to the title of the article exists;

  • The parent tag, which has no parent tag, such as django’s parent tag, which you can set to Python, is easier to manage and better read by humans or machines.

  • Tag cover, used to beautify the page, is more convenient to manage directly as a tag attribute, like the number of comments on the article, the number of views;

  • Picture description, here is mainly to consider the article SEO, SEO has always been very important, worthy of special attention;

  • Article tag is a very useful existence, can do related article recommendation, article SEO keywords and so on.

Blog users

Django inherits its default user attributes, such as user names, and extends them to other common blog attributes, such as Role, Mobile, and Website. For other uncertainties, we will make a general key/value model to store it later.

Blog comments

  • Critical article

  • Commenter Name

  • Commenter email

  • Commentators url

  • Reviewer content

  • Commenter user ID

  • Commenter IP, agent, notifications, etc

Five, blog management background

  • Article management, new or update article forms, rich text

  • Category management, article classification or label management

  • Comment management, spam comments, review and so on

  • Media management, upload pictures or other file management

  • User management, user roles, permissions and so on

  • Link management, friendship links or navigation menu management

Basically, blog program analysis here, if there are changes, such as user login access Github third-party login and so on.

The main goal of this revision is to change the front page of the blog and optimize the blog SEO. In the meantime, I take this opportunity to learn more about Django and hope to make progress with you all.