Where should utility functions live in Django?

后端 未结 3 834
日久生厌
日久生厌 2020-12-08 00:32

Where should utility functions live in Django? Functions like custom encrypting/decrypting a number, sending tweets, sending email, verifying object ownership, custom input

3条回答
  •  攒了一身酷
    2020-12-08 00:46

    Here is another way to do it:

    If the utility functions can be a stand-alone module and you are using a virtualenv environment for your django app then you can bundle the functionality as a package and install it in your virtualenv.

    This makes it easy to import where ever you need it in your django app.

提交回复
热议问题