A
A
alk2015-03-12 16:05:21
Django
alk, 2015-03-12 16:05:21

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

1 answer(s)
I
Ilya, 2015-03-12
@Alexey_Kutepov

Check out the excellent tutorial. Although it is listed in the requirements of python2.7, there will be no problems with python3.4 either. In the course of the tutorial, you will find answers to most of your questions.
How To Tango With Django

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question