Jump to content

About the static file path

Recommended Posts

I want to use a static file. So I create a static folder under the project folder and put the file under the static folder. And I also added the needed info in settings.py, url.py and the html. But it still doesn't work. Is the something wrong in my files? Or there is something which need the admin's configure?


What have been added in settings.py:



... ...

STATIC_URL = '/static/'

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




What added in url.py:


from django.conf.urls.static import static



What added in html:


{% load static %}


background-image: url("{% static "pyStocks/imgs/background-cloth.png"%}");



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...