Add template tag assign_format_str.
Update makedirs_for_filepath.