質問編集履歴
2
base.htmlファイルを追記しました。今追記していた際に、指摘頂いた「"topicsList_main" 」がビュー以外に書かれていない事に気づきました。そこが原因でしょうか?
title
CHANGED
File without changes
|
body
CHANGED
@@ -71,6 +71,30 @@
|
|
71
71
|
{% endblock content %}
|
72
72
|
```
|
73
73
|
|
74
|
+
base.html
|
75
|
+
```python
|
76
|
+
<!doctype html>
|
77
|
+
<html lang="en">
|
78
|
+
<head>
|
79
|
+
<!-- Required meta tags -->
|
80
|
+
<meta charset="utf-8">
|
81
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
82
|
+
<!-- Bootstrap CSS -->
|
83
|
+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
84
|
+
<title>Pachi Data</title>
|
85
|
+
</head>
|
86
|
+
<body>
|
87
|
+
{% block header %}
|
88
|
+
{% endblock header %}
|
89
|
+
{% block content %}
|
90
|
+
{% endblock content %}
|
91
|
+
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
|
92
|
+
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
93
|
+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
|
94
|
+
</body>
|
95
|
+
</html>
|
96
|
+
```
|
97
|
+
|
74
98
|
### 試したこと
|
75
99
|
このエラー文から、
|
76
100
|
list=[ ]の中にデータが入ってない為、for tag in ul_tag[0]:でデータが取得できていないのでは?
|
1
home.htmlファイルを追記しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -48,6 +48,29 @@
|
|
48
48
|
return render(request, 'list.html', context)
|
49
49
|
```
|
50
50
|
|
51
|
+
home.html
|
52
|
+
```python
|
53
|
+
{% extends 'base.html' %}
|
54
|
+
|
55
|
+
{% block header %}
|
56
|
+
<div class="jumbotron">
|
57
|
+
<div class="container">
|
58
|
+
<h1 class="display-4">News</h1>
|
59
|
+
<p class="lead">Enter the URL</p>
|
60
|
+
</div>
|
61
|
+
</div>
|
62
|
+
{% endblock header %}
|
63
|
+
|
64
|
+
{% block content %}
|
65
|
+
<div class="container">
|
66
|
+
<form action='' method='POST'>{% csrf_token %}
|
67
|
+
<p>URL: <input type="text" name='url'></p>
|
68
|
+
<input type="submit" value="取得する">
|
69
|
+
</form>
|
70
|
+
</div>
|
71
|
+
{% endblock content %}
|
72
|
+
```
|
73
|
+
|
51
74
|
### 試したこと
|
52
75
|
このエラー文から、
|
53
76
|
list=[ ]の中にデータが入ってない為、for tag in ul_tag[0]:でデータが取得できていないのでは?
|