以下の手順でokだと思ってたんだけどなぜかカンマ区切りにならず
エラーにもならず
1. INSTALLED_APPSに'django.contrib.humanize',を追加
INSTALLED_APPS = (
....
'django.contrib.humanize',
)
2. テンプレートに以下を追加
{% load humanize %}
3. 使う
{{ value|intcomma }}
調べたらNUMBER_GROUPINGの設定が必要だったみたい
NUMBER_GROUPING = 3
django.conf.locale.ja.formatsみるとこの手の設定が色々書いてあるけど、NUMBER_GROUPINGはコメントアウトされてた
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y年n月j日' TIME_FORMAT = 'G:i:s' DATETIME_FORMAT = 'Y年n月j日G:i:s' YEAR_MONTH_FORMAT = 'Y年n月' MONTH_DAY_FORMAT = 'n月j日' SHORT_DATE_FORMAT = 'Y/m/d' SHORT_DATETIME_FORMAT = 'Y/m/d G:i:s' # FIRST_DAY_OF_WEEK = # The *_INPUT_FORMATS strings use the Python strftime format syntax, # see http://docs.python.org/library/datetime.html#strftime-strptime-behavior # DATE_INPUT_FORMATS = # TIME_INPUT_FORMATS = # DATETIME_INPUT_FORMATS = DECIMAL_SEPARATOR = '.' THOUSAND_SEPARATOR = ',' # NUMBER_GROUPING =