Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
重複の可能性: Django アプリにカスタム モジュールを含めるにはどうすればよいですか
ビューで再利用したい関数があります。views.py 内でそれらを定義しますか? これを行うための「ジャンゴの方法」は何ですか?
ファイルを使用するプロジェクトを見たことがありutils.pyます。内部の関数が 1 つのアプリにのみ関連する場合は、apps ディレクトリに移動します。commonアプリ間で共有されている場合は、または同様の効果を持つアプリに移動できます。
utils.py
common