flask-command - A tool to use a flask+gunicorn app from the command line
flask-command is a simple tool that allows you to call your flask application from the command line after wrapping through gunicorn. This is useful if you’d like to create a console_script entry point for your flask application.
Intended Use Case
Let’s assume your project is called myproject. A flask app exists or is accessible from myproject/__init__.py. The following shows how you’d use flask-command.
In a file called myproject/main.py:
from flaskcommand import flask_command from myproject import app main = flask_command(app)
In your setup.py file:
setup(name='myproject',
version='0.0.1',
description="myproject - is awesome",
long_description="myproject - is really awesome",
keywords='',
author='Reuven V. Gonzales',
author_email='reuven@tobetter.us',
packages=['myproject'],
include_package_data=True,
zip_safe=False,
install_requires=[
'flask-command',
'flask',
],
entry_points={
'console_scripts': [
# WITH FLASK-COMMAND YOU CAN
# DEFINE YOUR SCRIPT HERE :-)
'myproject-web = myproject.main:main',
]
},
classifiers=[
'License :: OSI Approved :: MIT License',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
],
)
Now, after installing your project you can start your flask server like this:
$ myproject-web -b 127.0.0.1:8000 -w 4 some_config_path
At this time specifying a path to a configuration file is required, but this probably won’t be so in the future.
Metadata
Release files for flask-command 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flask-command-0.0.3.tar.gz | 3.3 kB | Without provenance | Details for flask-command-0.0.3.tar.gz |
Release files / flask-command-0.0.3.tar.gz
| Download URL | flask-command-0.0.3.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4fb1d40722c0b9c4cfd7660ddb088ef62a84648f18c75ee3d63565244631a420
|
|
BLAKE2b-256 checksum How to use checksums |
83aaa272cb527210789985593726114ca0eced01959e2417876b02d5723a6959
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for flask-command 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.