https://github.com/mschwager/py-httptemplate
A Python HTTP server template package.
https://github.com/mschwager/py-httptemplate
api async http python rest server
Last synced: 4 months ago
JSON representation
A Python HTTP server template package.
- Host: GitHub
- URL: https://github.com/mschwager/py-httptemplate
- Owner: mschwager
- License: apache-2.0
- Created: 2018-01-11T14:54:18.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-16T22:04:21.000Z (about 8 years ago)
- Last Synced: 2024-12-27T02:11:41.311Z (about 1 year ago)
- Topics: api, async, http, python, rest, server
- Language: Python
- Size: 66.4 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HTTP Server Template
[](https://travis-ci.org/mschwager/py-httptemplate)
[](https://coveralls.io/github/mschwager/py-httptemplate?branch=master)
Something simple to base your next web server off of! This project makes heavy
use of [aiohttp](https://aiohttp.readthedocs.io/en/stable/), and Python 3's
`asyncio` functionality.
With this you can:
* Do asynchronous things, handle many connections, web scale!
* Build that blog you've been dreaming of... but with Python!
* Integrate with PostgreSQL via [aiopg](https://aiopg.readthedocs.io/en/stable/), or MySQL via [aiomysql](https://aiomysql.readthedocs.io/en/latest/). Do database-y things, maintain state!
* Avoid repetitive structuring of your CRUD apps. Base it off this template!
* Place it behind [nginx](https://www.nginx.com/). Load balance! Serve static content! Add HTTP headers! Use SSL/TLS!
# Installing
```
$ git clone https://github.com/mschwager/py-httptemplate.git
$ cd py-httptemplate
$ docker-compose build
```
# Using
```
$ docker-compose up
Creating nginx ... done
Creating uitemplate1 ...
Creating uitemplate2 ...
Attaching to uitemplate1, uitemplate2, nginx
...
```
# Development
You should install the development packages before starting development:
```
$ pipenv install --dev
```
## Testing
```
$ pipenv run nose2 --with-coverage
......
----------------------------------------------------------------------
Ran 6 tests in 0.086s
OK
```
## Linting
```
$ pipenv run flake8 src
```
## Debugging
You can run `pipenv shell` to spawn a shell within the virtualenv. Now you're
free to debug within the package's environment at you're leisure.