Answer the question
In order to leave comments, you need to log in
How to make django render templates by getting them from the database?
Templates work on ginzh. Displayed the templates themselves through {{ some_html | safe }}, it generates the page well, but here's the problem: In the template itself, I want to place one more markup for the page. That is, in this rendered thing itself there is also an attachment, a la "{{ folderol | safe }}".
Is such perversion real? Or will you have to look for workarounds?
Google didn't give me anything about it, or I just didn't find how else to ask it.
Answer the question
In order to leave comments, you need to log in
This is not perversion. Batteries with WYSIWYG editors for the same Django work like this (django-ckeditor, django-tinymce, django-summernote, etc.).
Similar extensions for Flask should work in much the same way (see flask-ckeditor ). The difference is that Flask is flexible and can be prepared with different ORMs and DBMSs, so extension developers often take this into account.
But in general terms, the HTML output from the DBMS to the template looks like this:
| safe
.Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question