Skip to content

Commit 49e1b78

Browse files
committed
fix: web API return 500 for static files
1 parent 3b58620 commit 49e1b78

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

PastebinAPI/urls.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
2323
]
2424

25-
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT),
26-
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT),
25+
if settings.DEBUG:
26+
urlpatterns += static(settings.MEDIA_URL,
27+
document_root=settings.MEDIA_ROOT),
28+
urlpatterns += static(settings.STATIC_URL,
29+
document_root=settings.STATIC_ROOT),
2730

2831
urlpatterns += [
2932
path('', include('snippets.urls')),

Runtime.txt renamed to runtime.txt

File renamed without changes.

0 commit comments

Comments
 (0)