This chapter is accompanied by video tutorials :Python-Django Develop personal blog from scratch _ Bili, Bili _bilibili
One 、 utilize bulma css The provided components quickly implement the front-end style of the blog
Please refer to bulma file : Bulma: Free, open source, and modern CSS framework based on Flexbox
Two 、 Customize blog categories The template label is used by the whole station 【 Custom template labels and filters 】
Custom template labels and filters : Custom template labels and filters | Django file | Django
Self defined tags and filters Will be saved in the module named templatetags In the directory of . The name of the module file will be used for loading later tags Name , So be careful not to use one that may be customized with other applications tags and filters Conflicting names .
stay blog Create one in the directory templatetags Folder , And create a __init__.py
and category.py
The file of , Your app layout may look like this !