I have a Django application with some management commands. In one of these commands I need to write a log file which is located in / logs allong side views.py, models.py, etc.
Given that my script management command is in /management/commands/mycommand.py, is there any reliable way to determine the location of the appdir from mycommand.py?
PS: reliable, I mean without use os.path.abspath( __file__ ), because the location of the file may change later.
source
share