質問編集履歴

1

該当のソースコードにprojectフォルダ内のurls.pyを追記

2020/09/26 14:36

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -158,6 +158,78 @@
158
158
 
159
159
 
160
160
 
161
+ projectフォルダ内のurls.py
162
+
163
+ ```python
164
+
165
+ """project URL Configuration
166
+
167
+
168
+
169
+ The `urlpatterns` list routes URLs to views. For more information please see:
170
+
171
+ https://docs.djangoproject.com/en/2.2/topics/http/urls/
172
+
173
+ Examples:
174
+
175
+ Function views
176
+
177
+ 1. Add an import: from my_app import views
178
+
179
+ 2. Add a URL to urlpatterns: path('', views.home, name='home')
180
+
181
+ Class-based views
182
+
183
+ 1. Add an import: from other_app.views import Home
184
+
185
+ 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
186
+
187
+ Including another URLconf
188
+
189
+ 1. Import the include() function: from django.urls import include, path
190
+
191
+ 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
192
+
193
+ """
194
+
195
+ from django.conf import settings
196
+
197
+ from django.conf.urls.static import static
198
+
199
+ from django.contrib import admin
200
+
201
+ from django.urls import path, include
202
+
203
+
204
+
205
+
206
+
207
+ urlpatterns = [
208
+
209
+ path('admin/', admin.site.urls),
210
+
211
+ path('diaries/', include('diaries.urls')),
212
+
213
+ path('reviews/', include('reviews.urls')),
214
+
215
+ path('contact/', include('contact.urls')),
216
+
217
+ path('videos/', include('videos.urls')),
218
+
219
+ path('blog/', include('blog.urls')),
220
+
221
+ path('', include('myprofile.urls')),
222
+
223
+ ]
224
+
225
+
226
+
227
+ urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
228
+
229
+ ```
230
+
231
+
232
+
161
233
  ### 試したこと
162
234
 
163
235
  Djangoのアプリ起動に関してググった中では以下のコマンドしか見つけられず、複数のアプリをプロジェクト内に持つ場合の切り替えについての記事や説明を見つけられていない状態です。