Where someone should place any external python script for her Django project? What is the more appropriate location (if any)? Shall she create a folder in the main Django project and put it there and add this to the python path or is there a better way to deal with this issue? The reason for external scripts is not to overload the views with code that can be better organized in script files and can serve more than one views.
Create a folder, say utils, and make it a module by creating __init__.py
inside it.
Now create any script under this folder. Let's say you have a file called utils.py that contains some of your python code and you want to import it.
Wherever you want to import then import your python script like
from utils.utils import YourClassOrFunction
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With