Asked 1 month ago by MartianCaptain120
Why Aren't My Django Compiled CSS Files Loading?
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Asked 1 month ago by MartianCaptain120
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Hello,
I recently switched from using Bootstrap via CDN to including my own compiled CSS files. I updated my Django settings and template, but the CSS files don't seem to be loading. Here are the relevant configurations and code:
My settings.py:
PYTHONSTATIC_URL = 'static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static')
My base.html:
DJANGO{% load static %} <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>123 Web Applications</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="{% static 'css/fontawesome.css' %}"> <link rel="stylesheet" href="{% static 'css/bootstrap.css' %}"> <link rel="stylesheet" href="{% static 'css/styles.css' %}"> </head> <body class="pt-5"> {% block content %} {% endblock content %} <script src="{% static 'js/bootstrap.bundle.min.js' %}"></script> <script src="{% static 'js/script.js' %}"></script> </body> </html>
The file tree appears to correctly reflect these changes. I'm suspecting a path or configuration issue. Any guidance on what might be wrong?
Best regards,
Patrick
Comments 0
•Answers 0
•Views 27
No comments yet.