Is it possible to use multiple design templates in Django?
Is it possible to change the design templates of the website in Django? If Yes, then how to implement it? For example, drupal has the ability to control styles, even their standard is, the logic spelled out, from the database inserts all the data in the appropriate places of the html.
In General, Django is not a CMS and framework. Therefore, compared to Drupal/Wp etc. - is inappropriate. But nothing you do not interfere gash that logic yourself. Create model themes and themes_templates: first you will have to keep the theme, and the second path to the templates for them. Instead of paths to files to be stored and the template text - same ride. But it's not very "pretty" solution, I think.
In themes_templates make the type in which to store the type of template to indicate what specific template. In themes make is_active field that will specify which theme is currently active. In the view where you specify which template to render, go to database and get the path to the template (or content, if you decide to base in the form of a text file) depending on the active theme (themes.is_active = True) and template (each page has its own template).
Tiara_Cri answered on March 23rd 20 at 18:57
To take the template from the database - the worst idea
Don't ever do that