pip install django-compressor
python
INSTALLED_APPS = [
...
'compressor',
]
COMPRESS_ENABLED = True
html
{% load compress %}
<!DOCTYPE html>
<html>
<head>
{% compress css %}
<link rel="stylesheet" href="{% static 'css/style1.css' %}">
<link rel="stylesheet" href="{% static 'css/style2.css' %}">
{% endcompress %}
</head>
<body>
{% compress js %}
<script src="{% static 'js/script1.js' %}"></script>
<script src="{% static 'js/script2.js' %}"></script>
{% endcompress %}
</body>
</html>
python manage.py collectstatic