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.
March 23rd 20 at 18:53
2 answers
March 23rd 20 at 18:55
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).
March 23rd 20 at 18:57
To take the template from the database - the worst idea
Don't ever do that

Yes, cange the model Model View Template
Maybe I incorrectly formulated a question, just expand. If I wanted to change the design but keep the logic, I need to upload to hosting? I can't create 3 different design and just switch them when I need? - Perry_Stiedemann commented on March 23rd 20 at 19:00
@Perry_Stiedemann,

That means
I wanted to change the design but keep the logic
?

Why such a need? - Tiara_Cri commented on March 23rd 20 at 19:03
@Tiara_Cri, for example the site has Spasenie 1000 models of products, they are displayed from the database in a certain place in the HTML(design) I decided to bring beauty, to take and attach a brief description of each product. I have to rewrite the HTML and re-upload this page on web hosting In the most admin I can't do it? - Perry_Stiedemann commented on March 23rd 20 at 19:06
@Perry_Stiedemann,

If the model includes this field if it is given in view template if template his displays, there is nothing to edit in the project files is not required

If the admin made the edit for this field, there is nothing to edit in the project files is not required

You have not answered my previous questions - Tiara_Cri commented on March 23rd 20 at 19:09
@Perry_Stiedemann, Most of your questions because you didn't pass Jankowski tutorial - Tiara_Cri commented on March 23rd 20 at 19:12
@Tiara_Cri, but if I hat need to edit items to add, we need to add each field to the admin panel, which in the future can be changed?

P. S sorry for the possible stupid questions, I only understand all this) - Perry_Stiedemann commented on March 23rd 20 at 19:15
@Perry_Stiedemann,

Depends on the implementation
If implemented, it will be able - Tiara_Cri commented on March 23rd 20 at 19:18
To take the template from the database - the worst idea
Don't ever do that

Well, as it is not. Sometimes it is convenient to store in a database for quick custom changes. For example, email templates that are written in DTL and rendered that Archidona. If I'm wrong, then how to give the user the ability to change these patterns? - Una.Reilly9 commented on March 23rd 20 at 19:21
@Tiara_Cri, Yes, I know, I'm stuck on HTML and CSS along the way, understand) - Perry_Stiedemann commented on March 23rd 20 at 19:24
@Una.Reilly9,
A user who is able to otredaktirovat the template can have access to the file system for changes

Rhiniodon to write any template more than two lines in the browser
Passed on all smskah

Just the user should not edit the templates of the website
If the service is tied to the templates and they only deals - you scrutinise and write godlike wysiwyg

Not yet seen any even mediocre - Tiara_Cri commented on March 23rd 20 at 19:27
@Tiara_Cri, this is an extremely strange position: or write access to the file system, or forced WYSIWYG. We should realize so how convenient it is to common sense. In the case of messages are easier and more practical to keep in the database. - Una.Reilly9 commented on March 23rd 20 at 19:30
@Una.Reilly9,
No
Position normal
Common sense is nothing
In Python there is a kiss - and they need to be guided
kiss says that FS is easier - Tiara_Cri commented on March 23rd 20 at 19:33
@Tiara_Cri, In this case KISS — keep simple template to generate text messages in the database, and not stupid to give the user access to the file system where it is all crap will break, or burn the templates files to disk, which is even more stupid. Not to mention the complexity of implementation and potential du[s]of arts. If WYSIWYG is good, but the template itself this does not have to move to disk, because there is in it any sense at all. - Una.Reilly9 commented on March 23rd 20 at 19:36
@Una.Reilly9,
You continue to talk only about one option, when we have a service that provides newsletter templates

I'm not talking about this incident
TK it all rests not in the storage system, and the system steripod + editor in the browser

Difficulty writing to disk from your browser - no
Templates on disk do not differ from the images uploaded by the user - Tiara_Cri commented on March 23rd 20 at 19:39

Find more questions by tags Django