質問編集履歴

7

不要部分の削除

2017/02/11 17:50

投稿

PYPP
PYPP

スコア51

test CHANGED
File without changes
test CHANGED
@@ -12,65 +12,7 @@
12
12
 
13
13
  ###発生している問題・エラーメッセージ
14
14
 
15
- ![イメージ説明](e34e8372129e3d9c1debafa29af5d953.png)
16
-
17
15
  ![イメージ説明](0ea8ca25aafc2782ebb4d7e0c0e14487.png)
18
-
19
-
20
-
21
- ###該当のソースコード
22
-
23
- urls.py
24
-
25
- ```
26
-
27
- from django.conf.urls import include, url
28
-
29
- from . import views
30
-
31
-
32
-
33
- urlpatterns = [
34
-
35
- url(r'^$', views.post_list),
36
-
37
- url(r'^post/(?P<pk>[0-9]+)/$', views.post_detail),
38
-
39
- ]
40
-
41
- ```
42
-
43
- post_detail.html
44
-
45
- ```
46
-
47
- {% extends 'posts/base.html' %}
48
-
49
-
50
-
51
- {% block content %}
52
-
53
- <div class="post">
54
-
55
- {% if post.published_date %}
56
-
57
- <div class="date">
58
-
59
- {{ post.published_date }}
60
-
61
- </div>
62
-
63
- {% endif %}
64
-
65
- <h1>{{ post.title }}</h1>
66
-
67
- <p>{{ post.text|linebreaks }}</p>
68
-
69
- </div>
70
-
71
- {% endblock %}
72
-
73
- ```
74
16
 
75
17
 
76
18
 
@@ -94,10 +36,6 @@
94
36
 
95
37
  ```
96
38
 
97
- エラー
98
-
99
- ![イメージ説明](8da1d2d87b8e41ef867571fcdd71321e.png)
100
-
101
39
 
102
40
 
103
41
 
@@ -119,21 +57,3 @@
119
57
  <h1><a href="{% url 'detail' pk=post.pk %}">{{ post.title }}</a></h1>
120
58
 
121
59
  ```
122
-
123
- urls.py
124
-
125
- ```
126
-
127
- //before
128
-
129
- url(r'^post/(?P<pk>[0-9]+)/$', views.post_detail),
130
-
131
- //after
132
-
133
- url(r'^post/(?P<pk>[0-9]+)/$', views.post_detail, name='detail'),
134
-
135
- ```
136
-
137
- エラー
138
-
139
- ![イメージ説明](c49653be48b19ce8503b6cc5670c3e32.png)

6

試してみたことの追記

2017/02/11 17:50

投稿

PYPP
PYPP

スコア51

test CHANGED
File without changes
test CHANGED
@@ -74,7 +74,7 @@
74
74
 
75
75
 
76
76
 
77
- 試してみたこと
77
+ ###試してみたこと
78
78
 
79
79
  post_list.htmlを以下のように変更しましたが、エラーが出ました。
80
80
 
@@ -97,3 +97,43 @@
97
97
  エラー
98
98
 
99
99
  ![イメージ説明](8da1d2d87b8e41ef867571fcdd71321e.png)
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+ ###試してみたこと②
108
+
109
+ post_list.html
110
+
111
+ ```
112
+
113
+ //before
114
+
115
+ <h1><a href="{% url 'blog.views.post_detail' pk=post.pk %}">{{ post.title }}</a></h1>
116
+
117
+ //after
118
+
119
+ <h1><a href="{% url 'detail' pk=post.pk %}">{{ post.title }}</a></h1>
120
+
121
+ ```
122
+
123
+ urls.py
124
+
125
+ ```
126
+
127
+ //before
128
+
129
+ url(r'^post/(?P<pk>[0-9]+)/$', views.post_detail),
130
+
131
+ //after
132
+
133
+ url(r'^post/(?P<pk>[0-9]+)/$', views.post_detail, name='detail'),
134
+
135
+ ```
136
+
137
+ エラー
138
+
139
+ ![イメージ説明](c49653be48b19ce8503b6cc5670c3e32.png)

5

誤字の修正

2017/02/07 07:02

投稿

PYPP
PYPP

スコア51

test CHANGED
File without changes
test CHANGED
@@ -90,7 +90,7 @@
90
90
 
91
91
  ```
92
92
 
93
- <h1><a href="{% url 'blog.views.post_detail' pk=post.pk %}">{{ post.title }}</a></h1>
93
+ <h1><a href="{% url 'posts.views.post_detail' pk=post.pk %}">{{ post.title }}</a></h1>
94
94
 
95
95
  ```
96
96
 

4

試したことの追記

2017/02/07 05:25

投稿

PYPP
PYPP

スコア51

test CHANGED
File without changes
test CHANGED
@@ -71,3 +71,29 @@
71
71
  {% endblock %}
72
72
 
73
73
  ```
74
+
75
+
76
+
77
+ 試してみたこと
78
+
79
+ post_list.htmlを以下のように変更しましたが、エラーが出ました。
80
+
81
+ before
82
+
83
+ ```
84
+
85
+ <h1><a href="(% url 'posts.views.post_detail' pk=post.pk %)">{{ post.title }}</a></h1>
86
+
87
+ ```
88
+
89
+ after
90
+
91
+ ```
92
+
93
+ <h1><a href="{% url 'blog.views.post_detail' pk=post.pk %}">{{ post.title }}</a></h1>
94
+
95
+ ```
96
+
97
+ エラー
98
+
99
+ ![イメージ説明](8da1d2d87b8e41ef867571fcdd71321e.png)

3

タイトル変更

2017/02/07 05:19

投稿

PYPP
PYPP

スコア51

test CHANGED
@@ -1 +1 @@
1
- URL patternでのエラー
1
+ Page not foundというエラー
test CHANGED
File without changes

2

修正

2017/02/06 17:02

投稿

PYPP
PYPP

スコア51

test CHANGED
File without changes
test CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  DjangoGirlsというチュートリアルに従って、Pythonのdjangoを使いblogを作成しようとしています。そこで、ブログの一覧ページは作成できたものの、ページの詳細ページに行こうとするとエラーが出てしまいました。
4
4
 
5
- ■ チュートリアル
5
+ [チュートリアル](https://djangogirlsjapan.gitbooks.io/workshop_tutorialjp/content/extend_your_application/)
6
6
 
7
- https://djangogirlsjapan.gitbooks.io/workshop_tutorialjp/content/extend_your_application/
7
+
8
8
 
9
9
 
10
10
 

1

追記

2017/02/06 11:32

投稿

PYPP
PYPP

スコア51

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,10 @@
1
1
  ###前提・実現したいこと
2
2
 
3
3
  DjangoGirlsというチュートリアルに従って、Pythonのdjangoを使いblogを作成しようとしています。そこで、ブログの一覧ページは作成できたものの、ページの詳細ページに行こうとするとエラーが出てしまいました。
4
+
5
+ ■ チュートリアル
6
+
7
+ https://djangogirlsjapan.gitbooks.io/workshop_tutorialjp/content/extend_your_application/
4
8
 
5
9
 
6
10