Skip to content

Quickstart

Zachary Smith edited this page Apr 30, 2023 · 8 revisions

After installing the project, some environment setup is required:

Required setup

Create an app.py file containing your script, and an .envrc file to store project secrets. (Note: remember to add .envrc to your .gitignore) Look for example apps in ./python_web_io/tests.

.
├── .envrc
└── app.py

Add the following environment variable to your .envrc. (Note: remember to activate the .envrc in your terminal using direnv allow) Alternatively, run the command in your terminal to set the environment variable for a single session.

export FLASK_SECRET_KEY="_5#y2L"

Running the webapp

Installed using pip, you can call python-web-io as a CLI tool:

python_web_io

Using poetry, you can call it via:

poetry run python_web_io

Command line arguments

Whilst python-web-io is fully configurable via config.toml, some CLI arguments are made available for when using a non-default config.toml path, or testing an app.

Argument
--script="example.py" Optional Specify the file path for the app Python script.
--config="/.pythonwebio/config.toml" Optional Specify the file path for the app Python script.
--debug Optional Run the Flask server with debug output enabled.
Clone this wiki locally