(src, dest, replace=None)
Copy all files in the source path to the destination path.
    
    To replace boilerplate strings in the source data, pass a dictionary to the
    ``replace`` argument where each key is the boilerplate string and the
    corresponding value is the string which should replace it.
    
    The destination file paths are also parsed through the boilerplate
    replacements, so directories and file names may also be modified.
Copy all files in the source path to the destination path.
    
    To replace boilerplate strings in the source data, pass a dictionary to the
    ``replace`` argument where each key is the boilerplate string and the
    corresponding value is the string which should replace it.
    
    The destination file paths are also parsed through the boilerplate
    replacements, so directories and file names may also be modified.
Copy all files in the source path to the destination path . To replace boilerplate strings in the source data pass a dictionary to the replace argument where each key is the boilerplate string and the corresponding value is the string which should replace it . The destination file paths are also parsed through the boilerplate replacements so directories and file names may also be modified .
def copy_template(src, dest, replace=None):
    """
    Copy all files in the source path to the destination path.
    
    To replace boilerplate strings in the source data, pass a dictionary to the
    ``replace`` argument where each key is the boilerplate string and the
    corresponding value is the string which should replace it.
    
    The destination file paths are also parsed through the boilerplate
    replacements, so directories and file names may also be modified.
    
    """
    for path, dirs, files in os.walk(src):
        relative_path = path[len(src):].lstrip(os.sep)
        # Replace boilerplate strings in destination directory.
        for old_val, new_val in replace.items():
            relative_path = relative_path.replace(old_val, new_val)
        os.mkdir(os.path.join(dest, relative_path))
        for i, subdir in enumerate(dirs):
            if subdir.startswith('.'):
                del dirs[i]
        for filename in files:
            if (filename.startswith('.startproject') or
                filename.endswith('.pyc')):
                continue
            src_file_path = os.path.join(path, filename)
            # Replace boilerplate strings in destination filename.
            for old_val, new_val in replace.items():
                filename = filename.replace(old_val, new_val)
            dest_file_path = os.path.join(dest, relative_path, filename)
            copy_template_file(src_file_path, dest_file_path, replace)
def copy_template ( src , dest , replace = None ) : for path , dirs , files in os . walk ( src ) : relative_path = path [ len ( src ) : ] . lstrip ( os . sep ) # Replace boilerplate strings in destination directory. for old_val , new_val in replace . items ( ) : relative_path = relative_path . replace ( old_val , new_val ) os . mkdir ( os . path . join ( dest , relative_path ) ) for i , subdir in enumerate ( dirs ) : if subdir . startswith ( '.' ) : del dirs [ i ] for filename in files : if ( filename . startswith ( '.startproject' ) or filename . endswith ( '.pyc' ) ) : continue src_file_path = os . path . join ( path , filename ) # Replace boilerplate strings in destination filename. for old_val , new_val in replace . items ( ) : filename = filename . replace ( old_val , new_val ) dest_file_path = os . path . join ( dest , relative_path , filename ) copy_template_file ( src_file_path , dest_file_path , replace )