怎么打包flask资源文件

使用flask写了一个网站、目录结构如图所示

图片描述

打包程序为:

from distutils.core import setup from setuptools import

find_packages

setup(name='abc',

version='1.0',

description='abc Common Distribution',

author='aaa',

author_email='aaa',

url='aaaaa',

license="GPL",

packages=find_packages(),

include_package_data=True,

py_modules=["manage"], )

运行该程序生成的打包文件tar.gz文件解压打开没有 static文件夹和里面的资源以及tempaltes文件夹和里面的资源,请问需要如何设置打包程序?

回答:

https://packaging.python.org/en/latest/distributing.html

A “MANIFEST.in” is needed in certain cases where you need to package additional files that python setup.py sdist (or bdist_wheel) don’t automatically include.

For an example, see the MANIFEST.in from the PyPA sample project

For details on writing a MANIFEST.in file, see the The MANIFEST.in template section from the distutils documentation.

以上是 怎么打包flask资源文件 的全部内容, 来源链接: utcz.com/a/161046.html

回到顶部