[Answer]-How to rebuild template for django?

1👍

First, you should think separately about the items you want to show on the front end and how to collect them on the backend. Lets start with the latter.

It looks like you are putting together a list of sorts. It doesnt really matter how you want to prepare that list, or if its even as list (you can pass objects as well, if you like – though I wouldn’t recommend doing so in general practice as you might accidentally pass to the front end something you don’t mean to), as long as you do. This code is likely to be executed in your app/views.py

Once you have this list, you need to pass it to the template for it to render. Do this by passing context, in the example below called mycontext, to your template with something like:

 return render(request, 'help.html', context = mycontext)

In your template, you can now call out anything you passed via context. You may even perform for loops through this context if you would like. More details on dynamic templating here: https://docs.djangoproject.com/en/1.7/ref/templates/builtins/

Leave a comment