How to upload css file to Django?

Asked

Viewed 155 times

-1

I started studying Django and I have a problem, Django can not load CSS (NOTE: It was already CTRL+F5 and still does not load CSS)

Information that may be useful: STATIC_URL = '/Static/' inserir a descrição da imagem aqui

folder already created

inside that folder contains the css/Styles.css ,my html code is like this

I’ve already loaded {%load Static %}

When I display the source code of the page it lies like this:

"< link rel="stylesheet" href="/Static/css/Styles.css" />"

  • 1

    By the lack of details of your question I’m sure you haven’t read the documentation, if you can recommit something, I recommend that in addition to reading it, make the tutorial of the.

1 answer

0

Try using the following syntax in your templates:

<link rel="stylesheet" href={% static 'caminho/para/o/seu/arquivo.css' %}/>

Serves for any file inside the directory /static.

  • Solved, thanks a lot

Browser other questions tagged

You are not signed in. Login or sign up in order to post.