mschwager / py-httptemplate

A Python HTTP server template package.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTTP Server Template

Build Status Coverage Status

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.

About

A Python HTTP server template package.

License:Apache License 2.0


Languages

Language:Python 43.0%Language:HTML 41.8%Language:CSS 14.1%Language:JavaScript 1.1%