Your base.html page works correctly? Because you are using it in 
how_to.html page

On Sunday, 13 October 2019 17:33:57 UTC+5:30, John McClain wrote:
>
> Hello,
>
> I have built mvc django store and am able to see my images related to the 
> products I upload. However, I am not able to see images like banners or 
> such that are placed in html pages.
>
> I am not using virtual environment
>
> I am using vs code ide
>
> my site is served through free heroku version
>
> product images are hosted on s3 bucket
>
> I originally built the project in cloud9 then moved to gitpod and then now 
> am in vs code. Each time I have had to adjust the configuration to work in 
> the new environments. In this latest version I am now wanting to include 
> images unrelated to the products which are uploaded through the admin panel
>
> can anyone me figure out why they are not showing
>
> setting.py
>
> AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME
> # AWS_S3_CUSTOM_DOMAIN = '%s.s3-eu-west-1.amazonaws.com
> ' % AWS_STORAGE_BUCKET_NAME
>
>
> #STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
>
> STATICFILES_LOCATION = 'static'
> STATICFILES_STORAGE = 'custom_storages.StaticStorage'
>
> STATIC_URL = '/static/'
> STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
> # STATICFILES_DIRS = (
> #     os.path.join(BASE_DIR, "static"),
> # )
>
> MEDIAFILES_LOCATION = 'media'
> DEFAULT_FILE_STORAGE = 'custom_storages.MediaStorage'
>
> MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
> MEDIA_URL = "https://%s/%s/"; % (AWS_S3_CUSTOM_DOMAIN, MEDIAFILES_LOCATION)
>
>
> accounts/views.py
> def how_to(request):
>     """A view that displays the how_to page"""
>     return render(request, "how_to.html")
>
>
> how_to.html        html page lrft out other content just focusing on 
> drawing images to page at the monet
> {% extends 'base.html' %}
> {% load staticfiles %}
> {% block content %}
> <img src="{% static '/images/Hi-I-am-Alpha.png'%}" alt="">
> <img src="{% static '/images/and-I-am-Beta.png'%}" alt="">
> <img src="{% static '/images/and-I-am-Charlie.png'%}" alt="">
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d397cce1-1555-44f8-94e1-ee56559cf054%40googlegroups.com.

Reply via email to