def init(project_name):
    """
    build a minimal flask project
    """
    # the destination path
    dst_path = os.path.join(os.getcwd(), project_name)

    start_init_info(dst_path)

    # create dst path
    _mkdir_p(dst_path)

    os.chdir(dst_path)
    # create files
    init_code('manage.py', _manage_basic_code)
    init_code('requirement.txt', _requirement_code)

    # create app/
    app_path = os.path.join(dst_path, 'app')
    _mkdir_p(app_path)

    os.chdir(app_path)
    # create files
    init_code('views.py', _views_basic_code)
    init_code('forms.py', _forms_basic_code)
    init_code('__init__.py', _init_basic_code)

    create_templates_static_files(app_path)

    init_done_info()
def init ( project_name ) : dst_path = os . path . join ( os . getcwd ( ) , project_name ) start_init_info ( dst_path ) _mkdir_p ( dst_path ) os . chdir ( dst_path ) init_code ( 'manage.py' , _manage_basic_code ) init_code ( 'requirement.txt' , _requirement_code ) app_path = os . path . join ( dst_path , 'app' ) _mkdir_p ( app_path ) os . chdir ( app_path ) init_code ( 'views.py' , _views_basic_code ) init_code ( 'forms.py' , _forms_basic_code ) init_code ( '__init__.py' , _init_basic_code ) create_templates_static_files ( app_path ) init_done_info ( )
build a minimal flask project