Combining text and images on a page (noob's question)

Dear folks!

I’m new for Django. Sorry for the noob’s question, but I need some help.

I’m developing a website about birds of prey. My pages should contain complex information: text, images, hyperlinks, possibly even tables. Also I’d like to have some formatting (headers and so on). A random example how it can look like is here: https://habr.com/ru/post/473042/.

My question is, in what form a page’s content should be stored in the database:

  • HTML markup (flexible, but seems difficult to edit online)

  • In pieces: each block (image, paragraph, table) is stored separately.

  • Plain text with some markup (like BBCode or whatever).

  • Some other

I just noticed that the functionality of this visual editor would fit to my goals ideally. I’m even able to add images:

image

Please give me advice how I can provide this functionality, share your experience, perhaps provide some links.

I found different Django packages that deal with images, tables, and files, but separately. I need them all together.

Thanks!

There are a couple of questions that initially come to mind. Is this something for just you to use, or are there going to me multiple people adding content? This distinction is important, because it raises the issues of rights and permissions that may need to be managed on the system, and could also affect how you choose to implement it. (For example, you might be comfortable with using Markdown as your markup language, but you need to consider whether or not your other content contributors would be comfortable with it.)

Rather than starting from scratch using Django, you might want to take a look at a more full-featured CMS such as Wagtail or Django CMS.

If you don’t want to use either of those packages, you could at least study them to see how they function - that might give you some ideas.

Ken

1 Like

I recently discovered django-richtextfield. You can use it like a textfield but it gets displayed with a full fetched editor, for instance ckeditor.

1 Like