After deoploying to heroku it was initially working fine, but would disappear (I’m assuming because of the unmounting thing)
So some googling and I changed
DEBUG = False and also added
ALLOWED_HOSTS = ('localhost', '127.0.0.1', 'HEROKU LINK') but that didn’t fix the problems and now my images are not even being shown after upload
I’ve looked at a few solutions but nothing that really explains (or particularly works), it shows my image location as
Using Heroku for Django Media Files
My static files are fine, they don’t disappear only my images.
I have the heroku postgres addon as a database, do I need to add something like CLoudinary or AWS S3?
Or is there a way to get it working normally with Heroku (and not adding more cost to my side project blog)
STATIC_URL = '/static/' STATICFILES_DIR = ( os.path.join(BASE_DIR, 'build/static') ) STATIC_ROOT = os.path.join(BASE_DIR, 'static') MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
class BlogPost(models.Model): title = models.CharField(max_length=100, default='Title') slug = models.SlugField() category = models.CharField(max_length=55, choices=Categories.choices, default=Categories.RANDOM) thumbnail = models.ImageField(upload_to='photos/%Y/%m/%d/') excerpt = models.CharField(max_length=150) month = models.CharField(max_length=9) day = models.CharField(max_length=2) year =models.CharField(max_length=4, default='2021') content = models.TextField() featured = models.BooleanField(default=False) hide = models.BooleanField(default=False) date_created = models.DateTimeField(default=datetime.now, blank=True)