Open file in Django app
The solution has been described in the Favorite Django Tips&Tricks question. The solution is as follows:
import osmodule_dir = os.path.dirname(__file__) # get current directoryfile_path = os.path.join(module_dir, 'baz.txt')
Which does exactly what you mentioned.
Ps. Please do not overwrite file
variable, it is one of the builtins.