Answer the question
In order to leave comments, you need to log in
Blog: how to store articles correctly?
Good afternoon colleagues!
I started learning Django for myself and for learning purposes I am making a simple blog site.
The question arose: how to properly store articles that have images?
The first thing that comes to mind is to make a separate page for each article, but I want to make it possible to add new articles through the interface, and not by rewriting the site.
The second thing that came to mind was to store images as byte arrays in the database, but I don’t know how to draw these pictures on the page later.
The third option is to store images in the static folder and articles in the database. In the text of the article, store some conditional tags with the name of the files of these images and, when generating the page, parse the text, substitute the image address and display it. Here the question is: can django create files in and folders in static by its own means, and how will it behave if there are a lot of pictures?
In general, I have chaos and anarchy in my head on this topic, so I want to know how to properly implement such things.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question