Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
310 views
in Technique[技术] by (71.8m points)

python - Flask wheel file with static folder not being served

I am trying to serve static files from flask app. It is working fine in development environment from visual studio code.

I made .whl file from the project including static folder.

In setup.py

from setuptools import find_packages, setup

setup(
    name='techportal',
    #packages=['techportal'],
    packages=find_packages(),
    include_package_data=True,
    install_requires=[
        'flask',
    ],
)

In MANIFEST.IN

include myportal/static/*

Then I installed wheel and created wheel file

pip install wheel
python setup.py bdist_wheel

Installed it using pip

pip install ./myportal-0.1.whl

In linux production server I run app using:

waitress-serve --port=8080 'myportal:app'

But I am not able to open url using:

http://192.168.0.1:8080/static/index.html
question from:https://stackoverflow.com/questions/65904848/flask-wheel-file-with-static-folder-not-being-served

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...