2
respostas

Arquivos Static não estão carregando

No settings.py está assim:

STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'
STATICFILES_DIR = [
    os.path.join(BASE_DIR,'Sistema_Max/static')

criei o projeto com o " . " no final :

django-admin startproject Sistema_Max  .

fiz o python manage.py collectstatic da maneira correta:

python manage.py collectstatic

e meu arquivo .html está assim:

{% load static %} 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel='stylesheet'  href="{% static 'css/style.css' %}"/>
</head>
<body>
    <div class="principal">
        <div class="box">
           <img src="{% static 'img/santander.png' %}" class="face">


           <form class='form'>

                <label id="lb1">
                    <span></span>
                    <input type="text" class="input_text" name="sigla" placeholder="SIGLA"/>
                </label><br>
                <label id="lb2">
                    <span></span>
                    <input type="password" class="input_text" name="senha" placeholder="SENHA"/>
                </label><br>
                <button>
                    Entrar
                </button>

            </form>

        </div>
    </div>    

</body>
</html>

não sei o que pode ser, segui os passos certinhos das aulas.

2 respostas

Conseguir resolver, o problema foi que fiz as migrações antes de usar o collectstatic.

Oii Guilherme, como você está?

Fico feliz que tenha conseguido resolver. Qualquer dúvida que houver é só dizer, estou a disposição.

Abraços e bons estudos!