Answer the question
In order to leave comments, you need to log in
Is it possible to use multiple design patterns in Django?
Is it possible to change website design templates in Django? If yes, how to implement it? For example, drupal has the ability to manage styles, there are even standard ones, the logic is written, from the database it substitutes all the data in the right places in html.
Answer the question
In order to leave comments, you need to log in
In general, Django is not a CMS, but a framework. Therefore, to compare with Drupal / Wp, etc. - inappropriate. But nothing prevents you from filing this logic yourself. Create themes and themes_templates models: in the first one you will store the themes, and in the second - the paths to the templates for them. Instead of paths to files, you can store the templates themselves in text - it will also work. But this is not a very "beautiful" solution, I think.
In themes_templates , make a type field that will store the template type, which will indicate what the template is specifically for. In themes, make the field is_active, which will indicate which theme is currently active. In the view, where you specify which template to render, go to the database and pull out the desired path to the template (well, or its content, if you decide to store it in the database as text) depending on the active theme (themes.is_active = True) and type template (each page has its own template type).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question