Use {% load static %} instead of {% load staticfiles %} in templates by jdufresne · Pull Request #5773 · encode/django-rest-framework (original) (raw)

Starting with Django 1.10, it is preferable to load the static template tag library instead of staticfiles. If django.contrib.staticfiles is in INSTALLED_APPS, the static template tag library will use the staticfiles app to determine static paths. For additional details, see:

https://docs.djangoproject.com/en/dev/releases/1.10/#django-contrib-staticfiles

The static template tag now uses django.contrib.staticfiles if it’s in INSTALLED_APPS. This is especially useful for third-party apps which can now always use {% load static %} (instead of {% load staticfiles %} or {% load static from staticfiles %}) and not worry about whether or not the staticfiles app is installed.

The staticfiles template tag library will be deprecated and removed in a future Django version.