rendering specific div tag from views.py in django

Viewed 119

I am working on my final year project and I am stuck to rendering the specific page.

I have the following code. In accounts.html I have a div tag that contains anchor tags and by clicking them it will load another HTML page. here is my code for accounts.html:

<div class="row no-gutters row-bordered row-border-light">
            <div class="col-md-3 pt-0">
                <div class="list-group list-group-flush account-settings-links">
                    <a class="list-group-item list-group-item-action active" data-toggle="list"
                       href="#account-general">General</a>
                    <a class="list-group-item list-group-item-action" data-toggle="list"
                       href="#account-connections">Connections</a>
                    <a class="list-group-item list-group-item-action" data-toggle="list"
                       href="#account-change-password">Change password</a>
                    <a class="list-group-item list-group-item-action" data-toggle="list"
                       href="#account-delete-user">Delete Account</a>
                </div>
            </div>
            <div class="col-md-9">
                <div class="tab-content">
                    <div class="tab-pane fade active show" style="overflow-y:scroll; height:450px;"
                         id="account-general">
                        {% include 'EditProfile.html' %}
                    </div>
                    <div class="tab-pane fade" id="account-connections">
                        {% include 'connections.html' %}
                    </div>
                    <div class="tab-pane fade" id="account-change-password">
                        {% include 'change_password.html' %}
                    </div>
                    <div class="tab-pane fade" id="account-delete-user">
                        {% include 'delete_user.html' %}
                    </div>
                </div>

now I am trying to render a specific page from Django views.py and I tried this:

def fun(request):
    //logic
    return render(request, 'account.html','#account-connections')

by default it will always load #account-general on the page how can I! any help is appreciated!

0 Answers
Related