0

I'm working on my django app, and I have problem with one line of my code:

open(os.path.join(settings.BASE_DIR, 'templates', 'generated', 'calendar', month.strftime('%Y-%m.html')), 'w').write(html)

Should works fine, because when I printed this line of code I got full path to file.

No I got an error:

IOError: [Errno 2] No such file or directory

Kai
  • 553
  • 3
  • 7
  • 15
  • Possible duplicate of [Python: IOError: \[Errno 2\] No such file or directory](http://stackoverflow.com/questions/9765227/python-ioerror-errno-2-no-such-file-or-directory) – xRahul May 17 '17 at 11:04
  • Is `settings.BASE_DIR` a relative path? – spectras May 17 '17 at 11:06
  • What is the file path given in the error and how does your file system look - do all of the directories in the path exist? – Risadinha May 17 '17 at 12:45

0 Answers0