“Django estático” Respostas de código

Meu modelo de django não quer carregar o arquivo estático

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

STATICFILES_DIRS = ( 
    STATIC_ROOT,        
)
Cooperative Copperhead

Django estático arquivos / modelos

from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    # ... the rest of your URLconf goes here ...
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Nyn

Adicionar arquivo estático em django

STATICFILES_DIRS = [
    BASE_DIR / "static",
    '/var/www/static/',
]
Plain Pheasant

CSS Django

{% load static %}

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

Django estático arquivos / modelos

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "static"),
    '/var/www/static/',
]
Nyn

arquivos estáticos django

{% load static %}
<img src="{% static "my_app/example.jpg" %}" alt="My image">
Motionless Marten

Respostas semelhantes a “Django estático”

Perguntas semelhantes a “Django estático”

Mais respostas relacionadas para “Django estático” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código