Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use {% load static %} instead of {% load staticfiles %} in templates #5773

Merged
merged 1 commit into from Jan 26, 2018
Merged

Use {% load static %} instead of {% load staticfiles %} in templates #5773

merged 1 commit into from Jan 26, 2018

Conversation

jdufresne
Copy link
Contributor

@jdufresne jdufresne commented Jan 26, 2018

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.

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.
@rpkilby rpkilby merged commit 052a20c into encode:master Jan 26, 2018
1 check passed
@rpkilby
Copy link
Member

rpkilby commented Jan 26, 2018

Thanks @jdufresne!

@jdufresne jdufresne deleted the load-static branch Jan 27, 2018
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants