django render views from different apps on different bootstrap tabs

General Tech Bugs & Fixes 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I'm building a web app based on Django. My main html view has 3 bootstrap tabs like so:

{% block base %}

    <ul class="nav nav-tabs" style="margin-bottom: 20px;">
        <li class="active"><a data-toggle="tab" href="#mktcap">MarketCapa>li>
        <li><a data-toggle="tab" href="#portfo">Portfolioa>li>
        <li><a data-toggle="tab" href="#rank">Rankinga>li>
        

    ul>

    <div class="tab-content">
        <div id="mktcap" class="tab-pane fade in active">
            {% block mktcap %}{% endblock %}
        div>
        <div id="portfo" class="tab-pane fade">
            {% block portfolio %}{% endblock %}
        div>
        <div id="rank" class="tab-pane fade">
            {% block ranking %}{% endblock %}
        div>
    div>
div>

{% endblock base %}

I'm trying to build my app as modular as possible which is why I would like for each tab to be its own Django app. The problem I'm having is switching to the second "porfolio" tab. I am unable to render the view associated with portfolio whenever I switch the tab which results on the the contents being empty. What would be the best approach to go about this? Is there any way to achieve this without using AJAX?

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.