Using the Humanize part of Django templates

1,001 views
Skip to first unread message

MajorProgamming

unread,
Jun 23, 2009, 6:19:57 PM6/23/09
to Google App Engine
I am currently running an app that is ONLY using Django templates (not
the whole framework). I was wondering how I can use the
django.contrib.humanize part so I can use specialized filters? It
mentions something about INSTALLED_APPS, but I have no clue how to do
that?

Thanks,

Ian Lewis

unread,
Jun 24, 2009, 2:08:51 AM6/24/09
to google-a...@googlegroups.com
Thats the thing about Django. It tends to not work well unless you use the whole framework. INSTALLED_APPS is a setting in the settings.py in django. You'll probably need to create a settings.py and put 'django.contrib.humanize' in the INSTALLED_APPS list.

see: http://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
--
=======================================
株式会社ビープラウド  イアン・ルイス
〒150-0012
東京都渋谷区広尾1-11-2アイオス広尾ビル604
email: ianm...@beproud.jp
TEL:03-5795-2707
FAX:03-5795-2708
http://www.beproud.jp/
=======================================

MajorProgamming

unread,
Jun 24, 2009, 2:35:37 AM6/24/09
to Google App Engine
I created a settings.py file and added the INSTALLED APPS but nothing
helps. (the error, btw, is "TemplateSyntaxError: 'humanize' is not a
valid tag library: Could not load template library from
django.templatetags.humanize, No module named humanize"). Remember,
I'm not using Django; just the forms.

So how can I accomplish this? All I really want to do is automatically
put commas into numbers (e.g. 1000 => 1,000), by using templates...

On Jun 24, 2:08 am, Ian Lewis <ianmle...@gmail.com> wrote:
> Thats the thing about Django. It tends to not work well unless you use the
> whole framework. INSTALLED_APPS is a setting in the settings.py in django.
> You'll probably need to create a settings.py and put
> 'django.contrib.humanize' in the INSTALLED_APPS list.
>
> see:http://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
>
> On Wed, Jun 24, 2009 at 7:19 AM, MajorProgamming <sefira...@gmail.com>wrote:
>
>
>
> > I am currently running an app that is ONLY using Django templates (not
> > the whole framework). I was wondering how I can use the
> > django.contrib.humanize part so I can use specialized filters? It
> > mentions something about INSTALLED_APPS, but I have no clue how to do
> > that?
>
> > Thanks,
>
> --
> =======================================
> 株式会社ビープラウド イアン・ルイス
> 〒150-0012
> 東京都渋谷区広尾1-11-2アイオス広尾ビル604
> email: ianmle...@beproud.jp
> TEL:03-5795-2707
> FAX:03-5795-2708http://www.beproud.jp/
> =======================================

djidjadji

unread,
Jun 25, 2009, 1:09:18 AM6/25/09
to google-a...@googlegroups.com
Forget the settings.py file.
Have you tried to import the humanize file in the .py file that uses
the templates that needs these filters

import django.contrib.humanize.templatetags.humanize

The code will register the filters during the load.
NO need to use
{% load humanize %}
because the filters are already registered

2009/6/24 MajorProgamming <sefi...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages