Oldschool Web Development for Humans™
Project description
index.py
Although I've never used PHP, I like its hot-swap mechanism. I expect to use index.py to make Python's Web program deployment easier.
Install
pip install -U index.py
Or get the latest version on Github
git clone https://github.com/abersheeran/index.py
sudo python3 setup.py install
How to use
Execute the command index-cli dev
under the path where you place your Web program.
deploy
In linux, you can use index-cli gunicorn start
to start server.
-
-w INT
: The number of worker processes for handling requests. This value is best when it is equal to the number of cores of the CPU. -
-d
: Increasing this parameter will cause the program to run in the background and redirect the log to thelog.index
in the current directory.
Configuration
Environment variables
At startup, index automatically reads the configuration from the environment variable that begins with INDEX_
.
like this
INDEX_DEBUG=on
INDEX_ENV=pro
Config file
At the root of your web program, the configuration in config.json will be read when index starts.
example:
{
"dev": {
"debug": true,
},
"pro": {
"debug": false,
"port": 34567,
"host": "0.0.0.0"
}
}
List
-
ENV
ENV
is an important configuration that allows for the distinction between different configuration environments. -
LOG_LEVEL
log_level
has five values, the corresponding table to thelogging
is as followslog_level loggins "critical" logging.CRITICAL "error" logging.ERROR "warning" logging.WARNING "info" logging.INFO "debug" logging.DEBUG
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for index.py-0.0.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0d7d622468d76a8fc1ac495b9a54dda59416a48ec0bb85a14ca5d931bda4ae8 |
|
MD5 | d358a45762a146f54ac2a3db9d3bd075 |
|
BLAKE2b-256 | 6bb74b6e4e18b86c5f0e3b2317e7eae46598f70afcf21b7a2c904ff798abee9a |