Answer the question
In order to leave comments, you need to log in
Static in Django how?
I have this code in settings.py
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
{% load static %}
<link rel="stylesheet" href="{% static 'css/style.css' %}">
{% block links %}{% endblock %}
{% extends 'base.html' %}
{% load static %}
{% block links %}
<link rel="stylesheet" href="{% static 'css/style.css' %}">
{% endblock %}
Answer the question
In order to leave comments, you need to log in
If you are running the site in via runserver
, then you need to configure the distribution of statics in development mode .
If you run for real through uwsgi/gunicorn+nginx, then you need to configure nginx to distribute statics.
Well, do not forget about the team collectstatic
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question