<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>rinne_grid2_1</author_name>
  <author_url>https://blog.hatena.ne.jp/rinne_grid2_1/</author_url>
  <blog_title>気ままなタンス*プログラミングなどのノートブック</blog_title>
  <blog_url>https://www.rinsymbol.net/</blog_url>
  <categories>
    <anon>Django</anon>
    <anon>Python</anon>
  </categories>
  <description>テンプレートフィルタって便利ですよね。 Djangoの標準では様々なフィルタが用意されています。自作の処理でも、テンプレートフィルタのように、 Djangoテンプレートのコンテキスト出力時にメソッドを挟み込めたら・・・と考えて調べていたのですが・・・テンプレートフィルタは簡単に自作できることがわかりました！ 早速その方法について記述していきます。 templatetagsディレクトリを作成する ・アプリケーションディレクトリと同じ階層に作成します ・__init__.pyを作成し、パッケージ化する必要がありますディレクトリ構造としては、下記のようになります。 ROOT `-- project_…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.rinsymbol.net%2Fentry%2F2015%2F04%2F30%2F095552&quot; title=&quot;【Django】テンプレートフィルタを自作する方法について記述します - 気ままなタンス*プログラミングなどのノートブック&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2015-04-30 09:55:52</published>
  <title>【Django】テンプレートフィルタを自作する方法について記述します</title>
  <type>rich</type>
  <url>https://www.rinsymbol.net/entry/2015/04/30/095552</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
