Fix thumbnails

Repaired media upload thumbnails giving 404

Signed-off-by: Pratyush Desai <pratyush.desai@liberta.casa>
This commit is contained in:
Pratyush Desai 2025-04-21 00:32:49 +05:30
parent 0be9090981
commit 2fbf160920
Signed by: pratyush
GPG Key ID: DBA5BB7505946FAD
8 changed files with 22 additions and 3 deletions

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View File

@ -0,0 +1,20 @@
# Generated by Django 5.1.5 on 2025-04-20 18:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("webpanel", "0009_server_container_id_server_last_log"),
]
operations = [
migrations.AlterField(
model_name="game",
name="thumbnail",
field=models.ImageField(
blank=True, null=True, upload_to="game_thumbnails/"
),
),
]

View File

@ -7,8 +7,7 @@ from typing import Optional,List
class Game(models.Model):
name = models.CharField(max_length=100)
genre = models.CharField(max_length=50, blank=True, null=True)
thumbnail= models.ImageField(
upload_to='media/game_thumbnails/', null=True, blank=True)
thumbnail = models.ImageField(upload_to='game_thumbnails/', null=True, blank=True)
def __str__(self) -> str:
return self.name

View File

@ -7,4 +7,4 @@ urlpatterns = [
path('', views.home, name='home'),
path('games/', views.games, name='games'),
path('games/<str:game_name>/', views.game_detail, name='game_detail'),
]
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)