0

I'm trying to display an image located in my static directory. Here is my code :

My directories

enter image description here

My static settings

enter image description here

And finally, my template enter image description here

Luuklag
  • 3,897
  • 11
  • 38
  • 57
Fantasmo Clone27
  • 333
  • 1
  • 10
  • 19

2 Answers2

1

You have a typo in your settings.py

instead of STATICFILES_DIR, add the S

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static'),
]
Lemayzeur
  • 8,297
  • 3
  • 23
  • 50
0

Use below setting

STATIC_URL = '/static/'

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

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'staticfiles')
]

and move your image files to static folder

Difference between STATIC_ROOT, STATICFILES_DIRS and STATIC_URL can be found here

Mithun Sreedharan
  • 49,883
  • 70
  • 181
  • 236
  • 1
    STATIC_ROOT can't be the same as STATICFILES_DIRS, and it's the place to collect `static files` for deployment. – Lemayzeur May 10 '18 at 07:08