You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

staticfiles.py 720B

12345678910111213141516171819202122232425262728
  1. import warnings
  2. from django import template
  3. from django.templatetags.static import (
  4. do_static as _do_static, static as _static,
  5. )
  6. from django.utils.deprecation import RemovedInDjango30Warning
  7. register = template.Library()
  8. def static(path):
  9. warnings.warn(
  10. 'django.contrib.staticfiles.templatetags.static() is deprecated in '
  11. 'favor of django.templatetags.static.static().',
  12. RemovedInDjango30Warning,
  13. stacklevel=2,
  14. )
  15. return _static(path)
  16. @register.tag('static')
  17. def do_static(parser, token):
  18. warnings.warn(
  19. '{% load staticfiles %} is deprecated in favor of {% load static %}.',
  20. RemovedInDjango30Warning,
  21. )
  22. return _do_static(parser, token)