diff --git a/app/media/models.py b/app/media/models.py index 8062e11..aa6ed95 100644 --- a/app/media/models.py +++ b/app/media/models.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.db import models from django.urls import reverse @@ -9,7 +10,7 @@ class Image(models.Model): file = models.ImageField(upload_to='image', null=True, blank=True) def get_absolute_url(self): - return self.file.url + return '/' + settings.URL_PREFIX + self.file.url[1:] get_absolute_url.short_description = 'URL' def image_tag(self):