<head> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4-4.1.1/jq-3.3.1/dt-1.10.18/sl-1.2.6/datatables.min.css"/> <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> <script type="text/javascript" src="https://cdn.datatables.net/v/bs4-4.1.1/jq-3.3.1/dt-1.10.18/sl-1.2.6/datatables.min.js"></script></span> </head>
<script type="text/javascript">
$(document).ready( function () {
var table = $('#mytable').DataTable({
// プルダウンメニュー
"lengthMenu":[[5, 10, 25, 50, -1], [5, 10, 25, 50, "All"]],
// ページの保存
"stateSave":true
});
});
</script>
<table id="mytable" class="table table-striped table-bordered nowrap" width="100%">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Data 1</td>
<td>Row 1 Data 2</td>
</tr>
</tbody>
</table>
C:\Users\user\>django-admin startproject djangoMyLiteApp
C:\Users\user\djangoMyLiteApp>python manage.py runserver
C:\Users\user\djangoMyLiteApp>python manage.py startapp myliteapp
■djangoMyLiteApp ープロジェクト
└■djangoMyLiteApp ープロジェクトと同名のフォルダが生成される.
└■__pycache__
└__init__.py
└asgi.py
└settings.py
└urls.py
└wsgi.py
└■myliteapp ーアプリケーション
└■__pycache__
└■migrations ーデータベース関連.マイグレーションファイル作成時に生成.
└■templates ー新たに作成.
└■myliteapp ー新たに作成. 他のアプリケーションと重複しないように同名にします.
└index.html
└×××××.html
└__init__.py
└admin.py
└apps.py
└forms.py ー新たに作成.
└models.py ーモデルの定義を作成.
└tests.py
└urls.py ー新たに作成.
└views.py
└db_sqlite3
└manage.py
└show