HTTP Server Template
Something simple to base your next web server off of! This project makes heavy
use of aiohttp, 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, or MySQL via aiomysql. Do database-y things, maintain state!
- Avoid repetitive structuring of your CRUD apps. Base it off this template!
- Place it behind nginx. 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.