changing from os.mkdir() to os.makedirs()

If the path template/word/ doesn't exists the creation of template/word/media wouldn't be created since os.mkdir() doesn't create the intermetidate directories. os.makedirs() does it.