質問編集履歴
4
urls.pyを追加しました!
test
CHANGED
File without changes
|
test
CHANGED
@@ -266,6 +266,32 @@
|
|
266
266
|
|
267
267
|
|
268
268
|
|
269
|
+
```app/urls.py
|
270
|
+
|
271
|
+
from rest_framework import routers
|
272
|
+
|
273
|
+
from .views import UserViewSet, Post_officeViewSet,Good_tableViewSet,Follow_tableViewSet
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
app_name= "app"
|
278
|
+
|
279
|
+
router = routers.DefaultRouter()
|
280
|
+
|
281
|
+
router.register(r'users/', UserViewSet)
|
282
|
+
|
283
|
+
router.register(r'post_office/', Post_officeViewSet)
|
284
|
+
|
285
|
+
router.register(r'good_table', Good_tableViewSet)
|
286
|
+
|
287
|
+
router.register(r'follow_table', Follow_tableViewSet)
|
288
|
+
|
289
|
+
#snsを製作中です。
|
290
|
+
|
291
|
+
```
|
292
|
+
|
293
|
+
|
294
|
+
|
269
295
|
```tree
|
270
296
|
|
271
297
|
|
3
アプリ名が色々ごっちゃになってましたので、修正をしました。ご迷惑おかけしました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -38,7 +38,7 @@
|
|
38
38
|
|
39
39
|
# blog.urlsをincludeする
|
40
40
|
|
41
|
-
path(r'^api/', include("
|
41
|
+
path(r'^api/', include("app.urls")),
|
42
42
|
|
43
43
|
]
|
44
44
|
|
2
アプリ名が色々ごっちゃになってましたので、修正をしました。ご迷惑おかけしました。
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
from django.contrib import admin from django.urls import path,include # include を追記 #from p
|
1
|
+
from django.contrib import admin from django.urls import path,include # include を追記 #from app.url
|
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
raise ImproperlyConfigured(msg.format(name=self.urlconf_name)) from e
|
14
14
|
|
15
|
-
django.core.exceptions.ImproperlyConfigured: The included URLconf '
|
15
|
+
django.core.exceptions.ImproperlyConfigured: The included URLconf 'app.urls' does
|
16
16
|
|
17
17
|
not appear to have any patterns in it. If you see the 'urlpatterns' variable with
|
18
18
|
|
1
treeを追加しました。すいません!
test
CHANGED
File without changes
|
test
CHANGED
@@ -78,7 +78,7 @@
|
|
78
78
|
|
79
79
|
'django.contrib.staticfiles',
|
80
80
|
|
81
|
-
'
|
81
|
+
'app', #アプリ名
|
82
82
|
|
83
83
|
]
|
84
84
|
|
@@ -106,7 +106,7 @@
|
|
106
106
|
|
107
107
|
|
108
108
|
|
109
|
-
ROOT_URLCONF = '
|
109
|
+
ROOT_URLCONF = 'app.urls' #アプリ名
|
110
110
|
|
111
111
|
|
112
112
|
|
@@ -142,7 +142,7 @@
|
|
142
142
|
|
143
143
|
|
144
144
|
|
145
|
-
WSGI_APPLICATION = '
|
145
|
+
WSGI_APPLICATION = 'app.wsgi.application' #ご自身のアプリ名
|
146
146
|
|
147
147
|
|
148
148
|
|
@@ -266,4 +266,50 @@
|
|
266
266
|
|
267
267
|
|
268
268
|
|
269
|
-
|
269
|
+
```tree
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
├── config
|
274
|
+
|
275
|
+
│ ├── __init__.py
|
276
|
+
|
277
|
+
│ ├── __pycache__
|
278
|
+
|
279
|
+
│ ├── local_settings.py
|
280
|
+
|
281
|
+
│ ├── settings.py
|
282
|
+
|
283
|
+
│ ├── urls.py
|
284
|
+
|
285
|
+
│ └── wsgi.py
|
286
|
+
|
287
|
+
├── manage.py
|
288
|
+
|
289
|
+
└── app
|
290
|
+
|
291
|
+
├── __init__.py
|
292
|
+
|
293
|
+
├── __pycache__
|
294
|
+
|
295
|
+
├── admin.py
|
296
|
+
|
297
|
+
├── apps.py
|
298
|
+
|
299
|
+
├── migrations
|
300
|
+
|
301
|
+
│ └── __init__.py
|
302
|
+
|
303
|
+
├── models.py
|
304
|
+
|
305
|
+
├── serializer.py
|
306
|
+
|
307
|
+
├── tests.py
|
308
|
+
|
309
|
+
├── urls.py
|
310
|
+
|
311
|
+
└── views.py
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
```
|