(self, file_path, template_path, context_variables)
Takes template file and context variables and uses django's render method to create new file.
Takes template file and context variables and uses django's render method to create new file.
Takes template file and context variables and uses django s render method to create new file .
def create_file_from_template(self, file_path, template_path, context_variables):
        """
            Takes template file and context variables and uses django's render method to create new file.
        """
        if os.path.exists(file_path):
            print("\033[91m" + file_path + " already exists.  Skipping." + "\033[0m")
            return
        with open(file_path, 'w') as new_file:

            new_file.write(get_template(template_path).render(context_variables))
            print("\033[92m" + "successfully baked " + file_path + "\033[0m")
def create_file_from_template ( self , file_path , template_path , context_variables ) : if os . path . exists ( file_path ) : print ( "\033[91m" + file_path + " already exists.  Skipping." + "\033[0m" ) return with open ( file_path , 'w' ) as new_file : new_file . write ( get_template ( template_path ) . render ( context_variables ) ) print ( "\033[92m" + "successfully baked " + file_path + "\033[0m" )