1👍
✅
Lots of people create a utilities.py and put general purposes functions there.
Then, in your views.py:
from .utilities import function_name
If you want to use them across apps, it might be best to put them in your main project folder (I.e. where settings.py is) and import from there. Nothing stopping you from importing from one app to another, however. Just call it correctly.
👤Alex
Source:stackexchange.com