There are a couple of different possibilities here:
Your “current directory” in Django is not the directory where your code module resides. So referencing the name of the file without specifying the directory where it’s located could be causing this.
Or, depending upon how you have this deployed, if Django doesn’t have permissions to the file or the containing directory, that could also cause this.
It depends a lot upon the specifics of your deployment environment - how you’re running Django, what your directory structure may be, what UIDs / GIDs are involved, how those files are being created and copied to the site, etc, etc, etc.