files static error

37 views
Skip to first unread message

Leonardo Febres

unread,
Dec 6, 2020, 12:25:39 PM12/6/20
to Django users
Hola,

tengo un error en el enrutamiento y no logro definir por que, la version de django es 3.1.* es como que si la ruta declarada no existiera, agradeceria mucho su ayuda

ARCHIVO SETTINGS.PY

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
'apps.adopcion',
'apps.mascota',
]
-----------------------------------------------------------------------------
.
.
.
-----------------------------------------------------------------------------

# STATIC_ROOT = [Path(BASE_DIR, 'static')]
STATIC_URL = '/static/'
STATICFILES_DIR = [Path(BASE_DIR, 'static'),]
FIN ARCHIVO
-----------------------------------------------------------------------------


 ARCHIVO HTML

{% load static%}

<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
{% block extrastatic %}

{%endblock%}
<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.min' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/base.css' %}">

<title>{%block title %} documento {%endblock%}</title>
</head>


-----------------------------------------------------------------------------
diagrama de carpetas
-refugio
---apps
-----mascota
-----adopcion
---refugio
------settings.py
------+++++++++
---static
-------css
------------base.css
------------bootstrap.min.css
---template

Joel T

unread,
Dec 6, 2020, 9:58:29 PM12/6/20
to Django users
My spanish is at a zero, but unless django started accepting lists for the STATIC_ROOT settings, thats where the errror lies

could somebody tell the author to remove the square braces from the STATIC_ROOT argument and also to rename the path to something else since django doesn't accept for the STATIC_ROOT path to be included in the STATICFILES_DIRS setting.
Reply all
Reply to author
Forward
0 new messages