On 09/05/15 11:47, Bruno A. wrote:
Hi,

I've never done it, but I myself want to do a similar thing, so I've
been thinking about it a bit. The solutions I've thought of are the
following:

  * Template inheritance, as you mention. You provide the base template,
    but it might not be straightforward for the app's user to override.
    The Django's admin is a good example of this, and it can be
    customized partially or entirely by adding an admin directory in
    your site's templates directory, there are also some apps providing
    new interfaces
    <https://www.djangopackages.com/grids/g/admin-interface/> entirely.
  * Use the include tag
    <https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#include>
    to let your app's user define the main site canvas and just generate
    some basic HTML in the middle of their page, with their navbar,
    footer...
  * Along the same lines, provide in your apps custom template tags for
    the CSS, the JS you need and the content of your pages.

Now, I guess it depends on the complexity of the content your app
provide, whether you need parameters, etc...


Yeah I'll have to think about this some more. In all my previous projects I have just used straight up template inheritance but in those projects I haven't had to worry about a user needing to customise the look and feel of the site.

By providing a base template it makes the project easier to develop but I also think it makes it harder to customise by other users of the project as they have to plugin in their own base template and create the required blocks for the other templates to inherit from.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55513F37.1000000%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to