Fix thumbnails
Repaired media upload thumbnails giving 404 Signed-off-by: Pratyush Desai <pratyush.desai@liberta.casa>
This commit is contained in:
		
							parent
							
								
									0be9090981
								
							
						
					
					
						commit
						2fbf160920
					
				| 
		 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  | 
							
								
								
									
										20
									
								
								webpanel/migrations/0010_alter_game_thumbnail.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								webpanel/migrations/0010_alter_game_thumbnail.py
									
									
									
									
									
										Normal 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/"
 | 
			
		||||
            ),
 | 
			
		||||
        ),
 | 
			
		||||
    ]
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
@ -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)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user