Running of index.html file

43 views
Skip to first unread message

Mukul Dharwala

unread,
Jul 23, 2019, 10:59:25 PM7/23/19
to Django users
All files are working except this one its images are not showing as well as whenever i am putting{%load %} in front of any css file or jpg file it is showing an error. plzz go through my code and help me correcting it 
index.html

vignesh karthik

unread,
Jul 23, 2019, 11:51:28 PM7/23/19
to django...@googlegroups.com
Hi there,

in settings.py

under 

STATIC_URL = '/static'

Add below Lines


STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'static'),
)

Thank you

On Wed, Jul 24, 2019 at 8:30 AM Mukul Dharwala <dharwa...@gmail.com> wrote:
All files are working except this one its images are not showing as well as whenever i am putting{%load %} in front of any css file or jpg file it is showing an error. plzz go through my code and help me correcting it 

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ef6dc860-24bb-417b-9f97-98728eaad29b%40googlegroups.com.


--
vignesh

Mukul Dharwala

unread,
Jul 23, 2019, 11:52:36 PM7/23/19
to django...@googlegroups.com
thanks brother but i have tried everything

vignesh karthik

unread,
Jul 23, 2019, 11:56:49 PM7/23/19
to django...@googlegroups.com
did you try install pillow..if it is not try this command

pip install pillow



--
vignesh

Mukul Dharwala

unread,
Jul 23, 2019, 11:58:40 PM7/23/19
to django...@googlegroups.com

vignesh karthik

unread,
Jul 24, 2019, 12:05:14 AM7/24/19
to django...@googlegroups.com
image.png


style="background-image: url('{% static 'images/bg_2.jpg' %}');">

Instead put below line

style="background-image: url({% static 'images/bg_2.jpg' %});">

Remove single quotes before ('{%static




--
vignesh

Mukul Dharwala

unread,
Jul 24, 2019, 12:07:46 AM7/24/19
to django...@googlegroups.com
This is the exact problem whenever i am doing this its showing an error during these images. Help me brother there is a deadline near for internship and i am thinking about uploading this as my framework

vignesh karthik

unread,
Jul 24, 2019, 12:14:28 AM7/24/19
to django...@googlegroups.com
if u dont mind could you send me a project files as zip...

so i can easily troubleshoot




--
vignesh
Reply all
Reply to author
Forward
0 new messages