i uploaded my Media directory which contains my Images but i cant access it to display
my images. My images are correctly being uploaded when i send them, but i cant view them in the page
Im utilizing ElasticBeanstalk and RDS - Mysql
I only configured my RDS everything else like EC2, S3 are automattically configured by ElasticBeanstalk
commands I used on eb:
eb init
eb create
eb deploy
static-files.config:
option_settings:
aws:elasticbeanstalk:environment:proxy:staticfiles:
/static: static
/media: media
django.config:
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: store.wsgi:application
01_packages.config:
packages:
yum:
python3-devel: []
mariadb-devel: []
models.py:
class Product(models.Model):
image = models.ImageField(upload_to='product_images/%Y/%m/%d')
settings.py:
MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'
my html:
<a href="{{product.get_absolute_url}}">
<img class="default-img" src="{{product.image.url}}}" alt="550x750">
</a>