[Fixed]-Django CMS get all models defined in the admin

1👍

My suggestion is , write a view and create object for the model and render to template html.

For example:

from models import Faq
def faq_view(request):
    faqs = Faq.objects.all()

    return render_to_response('faq.html', {'faqs': faqs})

Then in faq.html write a for loop and display like below.

<ul>
{% for faq in faqs %}
    <li><strong>{{faq.question}}</strong></li>
    <li>{{faq.answer}}</li>
{% endfor %}
 </ul>

I hope this will help you.

Leave a comment