I've been working on a project using django 1.7,
and below is my settings.py configuration:
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "assets"),
)
STATIC_ROOT = "absolute/path/to/static"
In the 'assets' folder I created, all CSS and JS files are stored. After running the collectstatic command, a static folder was generated.
This is how I reference CSS and JS files in my HTML:
{% load staticfiles %}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Login</title>
<link href="{% static '/static/css/bootstrap.min.css' %}" rel="stylesheet">
However, when I start the server, although all CSS and JS files are loaded (showing 200 OK status in the developer section), the CSS styles are not applied, making the HTML page look unformatted as if no CSS was used.
I'm new to Django - can someone kindly guide me in the right direction?
Thank you in advance.
EDIT:
When checking the browser developer console, I noticed this message:
Resource interpreted as Stylesheet but transferred with MIME type text/plain: ".../static/css/bootstrap.min.css".