Python - Flask tutorial 7 - TabPanels

by: stljim, 8 years ago


From the tutorial on tabpanels, the only results I get back are for the 'basics' tab, it's the default.  There is no actions/results clicking on the other tabs.  I'm sure I'm missing something basic.

http://127.0.0.1:5000/dashboard#basics
http://127.0.0.1:5000/dashboard#wdev
http://127.0.0.1:5000/dashboard#dbs

Any help would be greatly appreciated.  


{% extends "header.html" %}

{% block body %}
<div role="tabpanel">
  <!-- Nav tabs -->
  <ul class="nav nav-tabs" role="tablist">
    <li role="presentation" class="active"><a href="#basics" aria-controls="basics" role="tab" data-toggle="tab">Basics</a></li>
    <li role="presentation"><a href="#wdev" aria-controls="wdev" role="tab" data-toggle="tab">Web Dev</a></li>
    <li role="presentation"><a href="#dbs" aria-controls="databases" role="tab" data-toggle="tab">Databases</a></li>
  </ul>

  <!-- Tab panes -->
  <div class="tab-content">
    <div role="tabpanel" class="tab-pane fade in active" id="basics">Basic stuff here</div>
    <div role="tabpanel" class="tab-pane fade" id="wdev">Web dev stuff here</div>
    <div role="tabpanel" class="tab-pane fade" id="dbs">Database stuff here</div>
  </div>

</div>
<h1> Hello this is the dashboard</h1>
{% endblock %}


Have you considered putting the code for your tutorials on github?



You must be logged in to post. Please login or register an account.



Possibly missing some of the required javascript? Otherwise not sure.

I often do put sample code on https://github.com/pythonprogramming

...but I haven't done it recently much. I just post the full code per part at the end of tutorials as of late. You could poke into https://github.com/PythonProgramming/PythonProgramming.net-Website

-Harrison 8 years ago

You must be logged in to post. Please login or register an account.


It really really really help when you specify a source, src, parameter in a script that you spell it src and NOT SCR!

 <script scr="static/js/jquery-1.12.4.min.js"></script> != <script src="static/js/jquery-1.12.4.min.js"></script>  


Why PyCharm doesnt' 'catch' that I don't know, it should.  Anyway, I'm an idiot!

-stljim 8 years ago

You must be logged in to post. Please login or register an account.