I read these guides to create my project.
First, creating a tar zip file.I create many files in my project folder. setup.py
from setuptools import setup, find_packages
setup(
name='WebMonitor',
version='1.0',
long_description=__doc__,
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=['Flask>=0.12']
)
MANIFEST.in
include schema.sql
include __init__.py
include auth.py
include blog.py
include db.py
graft static
graft templates
global-exclude *.pyc
setup.cfg
[egg_info]
tag_build = .dev
tag_date = 1
[aliases]
release = egg_info -Db ''
Then I run this command python setup.py release sdist to build a release package.
Second, install and run this app.
- Create a virtual environment with the command virtualenv env
- Activate the env with env\Scripts\activate
- Install the release package by pip install WebMonitor-1.0.tar.gz
- set FLASK_APP=WebMonitor
Then run my app flask run -h 127.0.0.1 -p 5001. I get an error output:
- Serving Flask app "WebMonitor"
- Environment: production WARNING: Do not use the development server in a production environment. Use a production WSGI server instead.
- Debug mode: off Usage: flask run [OPTIONS]
Error: Could not import "WebMonitor".
Does anyone know how to solve this problem? Thank you very much.