Django blog project ideas, django blog ideas
First of all, it is clear that I am studying Django to create a blog, so if I want to practice it with the goal of blog, follow
Consider the following things in the order of Django's MTV model:
(Models)
1. Various data models in the blog:
A. Blog Model
Attributes include title, release time, body part, abstract, label, and directory.
The body and abstract should support various text formats and syntax highlighting. In this regard, I chose markdown for rendering.
B. Consider the relationship between the blog model and the label and the directory. They are multi-to-many and multi-to-one, so they are labels.
Separate models with Directories
C. Comment Model
Attributes: reviewer name, comment subject, comment time
(Template)
2. The second step is to consider the overall blog interface and layout. In short, we need to consider the frontend. In this regard, I plan to temporarily
The next html template is modified to create a django template. After all, the front-end knowledge is profound and needs to be learned again.
It consumes a lot of energy.
(View)
3. Step 3 consider the key part of django, the view part, and respond to various URLs and forms for submission. View Functions
It is also necessary to pass key information (blog information and comment information in the database) to the django template for display to read.
See.
(Other tasks)
4. Configure the url and pass some parameters to the view function when the user accesses the url, such as accessing the http://myblog.com/post/1
You can pass the value 1 at the end to the view function as a parameter, and then let the view function find the blog model instance with id = 1 in the database.
Pass the information to the template and use the template to present the data to the user.