Name | lessweb JSON |
Version |
1.5.0
JSON |
| download |
home_page | None |
Summary | A pythonic web framework |
upload_time | 2024-06-21 02:21:17 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | Apache 2 |
keywords |
lessweb
web
web.py
aiohttp
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# lessweb
>「嘞是web」
Lessweb is an extremely easy-to-use python web framework with the following goals.
* Simple and efficient: based on the aiohttp library IOC capabilities, native support for configuration loading and logging settings to meet production-level development requirements
* Pythonic: support for the latest python version and the latest python syntax
## Install lessweb
To install the latest lessweb for Python 3, please run:
```shell
pip3 install lessweb
```
## Hello, world!
Save the code below in file `index.py`:
```python
from lessweb import Bridge, get_mapping
@get_mapping('/')
async def hello():
return {'message': 'Hello, world!'}
def main():
bridge = Bridge()
bridge.add_route(hello)
bridge.run_app()
if __name__ == '__main__':
main()
```
Start the application with the command below, it listens on `http://localhost:8080/` by default.
```
python3 index.py
```
## Setting port
Save the code below in file `config.toml`:
```toml
[bootstrap]
port = 80
```
Then change the code to:
```python
def main():
bridge = Bridge(config='config.toml')
bridge.add_route(hello)
bridge.run_app()
```
Once you run it, you can access `http://localhost/` with your browser.
You can also use environment variables to override the configuration file's contents, e.g. run `BOOTSTRAP_PORT=8081 python3 index.py`, then it listens on `http://localhost:8081`.
## License
Lessweb is offered under the Apache 2 license.
## Source code
The latest developer version is available in a GitHub repository: https://github.com/lessweb/lessweb
## Cookbook
### https://github.com/lessweb/lessweb/wiki
## Cookbook【中文】:
### http://www.lessweb.cn
Raw data
{
"_id": null,
"home_page": null,
"name": "lessweb",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "lessweb, web, web.py, aiohttp",
"author": null,
"author_email": "qorzj <goodhorsezxj@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/dc/95/94f9f212770ab42ec6504f6230d32ce3275d5cdb47ae32478b76581923c0/lessweb-1.5.0.tar.gz",
"platform": null,
"description": "# lessweb\n>\u300c\u561e\u662fweb\u300d\n\nLessweb is an extremely easy-to-use python web framework with the following goals.\n\n* Simple and efficient: based on the aiohttp library IOC capabilities, native support for configuration loading and logging settings to meet production-level development requirements\n* Pythonic: support for the latest python version and the latest python syntax\n\n## Install lessweb\n\nTo install the latest lessweb for Python 3, please run:\n\n```shell\npip3 install lessweb\n```\n\n## Hello, world!\n\nSave the code below in file `index.py`:\n\n```python\nfrom lessweb import Bridge, get_mapping\n\n@get_mapping('/')\nasync def hello():\n return {'message': 'Hello, world!'}\n\ndef main():\n bridge = Bridge()\n bridge.add_route(hello)\n bridge.run_app()\n\nif __name__ == '__main__':\n main()\n```\n\nStart the application with the command below, it listens on `http://localhost:8080/` by default.\n\n```\npython3 index.py\n```\n\n## Setting port\n\nSave the code below in file `config.toml`:\n\n```toml\n[bootstrap]\nport = 80\n```\n\nThen change the code to:\n\n```python\ndef main():\n bridge = Bridge(config='config.toml')\n bridge.add_route(hello)\n bridge.run_app()\n```\n\nOnce you run it, you can access `http://localhost/` with your browser.\n\nYou can also use environment variables to override the configuration file's contents, e.g. run `BOOTSTRAP_PORT=8081 python3 index.py`, then it listens on `http://localhost:8081`.\n\n## License\n\nLessweb is offered under the Apache 2 license.\n\n## Source code\n\nThe latest developer version is available in a GitHub repository: https://github.com/lessweb/lessweb\n\n## Cookbook\n### https://github.com/lessweb/lessweb/wiki\n\n## Cookbook\u3010\u4e2d\u6587\u3011\uff1a\n### http://www.lessweb.cn\n",
"bugtrack_url": null,
"license": "Apache 2",
"summary": "A pythonic web framework",
"version": "1.5.0",
"project_urls": null,
"split_keywords": [
"lessweb",
" web",
" web.py",
" aiohttp"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "32d58dc91d41a5c82204689ccf9f3a91a5c9d9788e5deb9602783a3868acfee6",
"md5": "11b9909f45e17f0f3fce5a6482a94eac",
"sha256": "b25453175b463e83a2dc6efe244b88e103e090e5c51ebc0b432f5530ccd1af12"
},
"downloads": -1,
"filename": "lessweb-1.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "11b9909f45e17f0f3fce5a6482a94eac",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 11170,
"upload_time": "2024-06-21T02:21:14",
"upload_time_iso_8601": "2024-06-21T02:21:14.931010Z",
"url": "https://files.pythonhosted.org/packages/32/d5/8dc91d41a5c82204689ccf9f3a91a5c9d9788e5deb9602783a3868acfee6/lessweb-1.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dc9594f9f212770ab42ec6504f6230d32ce3275d5cdb47ae32478b76581923c0",
"md5": "fae44ae958c28bcdbbf56dda2a0c053a",
"sha256": "949244511e301bd70727cf20f5c179dbc6f3bd58cca7dc555aa0a60dd00302dd"
},
"downloads": -1,
"filename": "lessweb-1.5.0.tar.gz",
"has_sig": false,
"md5_digest": "fae44ae958c28bcdbbf56dda2a0c053a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 19176,
"upload_time": "2024-06-21T02:21:17",
"upload_time_iso_8601": "2024-06-21T02:21:17.176959Z",
"url": "https://files.pythonhosted.org/packages/dc/95/94f9f212770ab42ec6504f6230d32ce3275d5cdb47ae32478b76581923c0/lessweb-1.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-21 02:21:17",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "lessweb"
}