Skip to content

Commit

Permalink
static 설정 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Hwang-Jaeryeong committed Jan 23, 2024
1 parent 5ea4ba6 commit 1bc8e4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stadium/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Stadium(models.Model):
team_name = models.CharField(max_length=255)
stadium = models.CharField(max_length=255)
stadium_image = models.ImageField(upload_to='stadium_images/', null=True, blank=True)
stadium_image = models.ImageField(upload_to='team_logos/', null=True, blank=True)

def __str__(self):
return self.team_name
Expand Down
5 changes: 5 additions & 0 deletions stadium/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
from django.urls import path
from django.conf.urls.static import static
from madcamp_week4_BE import settings
from .views import StadiumAPIView, StadiumUpload

urlpatterns = [
path('', StadiumAPIView.as_view(), name='get-stadium'),
path('upload/', StadiumUpload.as_view(), name='stadium-upload'),
]


if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

0 comments on commit 1bc8e4d

Please sign in to comment.