Nice to meet you, this is koki1992. This is the first post. I look forward to working with you. I'm a student now, and from next year I'm planning to jump into an industry that has nothing to do with programming. The class was canceled due to the spread of Covid-19, and I had some time left, so I started Quita.
When you create a Django template, in that app's folder,
mkdir templates/<App name>/
I think that you will create a folder and save the template in this. However, as the number of templates increases, I think that one folder will contain dozens of template files.
In this case, even if you name the template neatly, it will be difficult to reach the target template file, which can be frustrating.
So, in my case, when the application grows to a certain extent, I try to divide the template files into folders within the template folder.
I am making an app for organizing my information, and I will show you the template structure of that app. Although it is a configuration
In an app called NOTE
I made the element. There is a Note in the Binder, a Page in the Note, and a Block in the Page.
Each element has a template for new creation, update, and deletion in addition to the template displayed by that element.
That's why it became like this.
├── templates
│ └── NOTE
│ ├── Binder
│ │ ├── Binders.html
│ │ ├── CreateBinder.html
│ │ ├── DeleteBinder.html
│ │ └── UpdateBinder.html
│ ├── Block
│ │ ├── Blocks.html
│ │ ├── CreateBlock.html
│ │ ├── DeleteBlock.html
│ │ └── UpdateBlock.html
│ ├── Note
│ │ ├── CreateNote.html
│ │ ├── DeleteNote.html
│ │ ├── Notes.html
│ │ └── UpdateNote.html
│ └── Page
│ ├── CreatePage.html
│ ├── DeletePage.html
│ ├── Pages.html
│ └── UpdatePage.html
It's organized and much easier to read than just digging the template files into the template folder without thinking about it.
Thank you for watching until the end. I'm still an amateur, but I'd like to manage to gather information on the internet and improve my skills. I would like to write an article about the knowledge gained in the process. We look forward to your opinions and impressions.
I also started Twitter. If you don't mind, please follow me.
Recommended Posts