0
<script src="./home/static/js/2.d754fc32.chunk.js"></script>

Currently my html file points to this. What static variable django setting.py do I declare to make the HTML point to

<script src="./home/static/static/js/2.d754fc32.chunk.js"></script>

currently in setting.py

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, '../frontend/build')
]

STATIC_ROOT = '/var/www/web/home/static/'
STATIC_URL = 'home/static/'

My build folder contains a static file inside as well.

Travis Tay
  • 350
  • 2
  • 10
  • what do you mean by What static variable django setting.py do I declare to make the HTML point to, please elaborate. – iklinac Jun 24 '20 at 11:12

1 Answers1

1

if STATICFILES_DIR is in the right place:

You just have to {% load 'static' %} on the top of your html (after extend), and to set the css file:

    <link rel="stylesheet" type="text/css" href="{% static '/style.css' %}">

if you want a img from there would be:

<img src="{% static '<PathOfImage>/img.png' %}">
lucasrf27
  • 350
  • 2
  • 16