Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paulocheque/bottle-toolbelt
https://github.com/paulocheque/bottle-toolbelt
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/paulocheque/bottle-toolbelt
- Owner: paulocheque
- License: other
- Created: 2016-01-18T16:57:00.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-04T20:06:20.000Z (almost 7 years ago)
- Last Synced: 2024-12-02T07:55:54.282Z (25 days ago)
- Language: Python
- Size: 14.6 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
bottle-toolbelt
======================[![Build Status](https://travis-ci.org/paulocheque/bottle-toolbelt.png?branch=master)](https://travis-ci.org/paulocheque/bottle-toolbelt)
[![Docs Status](https://readthedocs.org/projects/bottle-toolbelt/badge/?version=latest)](http://bottle-toolbelt.readthedocs.org/en/latest/index.html)
[![Coverage Status](https://coveralls.io/repos/paulocheque/bottle-toolbelt/badge.png?branch=master)](https://coveralls.io/r/paulocheque/bash?branch=master)
[![Code Status](https://landscape.io/github/paulocheque/bottle-toolbelt/master/landscape.png)](https://landscape.io/github/paulocheque/bottle-toolbelt/)
[![PyPi version](https://pypip.in/v/bottle-toolbelt/badge.png)](https://crate.io/packages/bottle-toolbelt/)
[![PyPi downloads](https://pypip.in/d/bottle-toolbelt/badge.png)](https://crate.io/packages/bottle-toolbelt/)**Latest version: 0.0.1 (2016/01)**
Utility methods to facilitate automation of devops tasks. Good to be used with Fabric or Invoke.
Documentation
-------------http://bottle-toolbelt.readthedocs.org/en/latest/index.html
Your *run.py* file:
if __name__ == "__main__":
import bottlefrom toolbelt.middleware import cors_options # OPTIONS routes
from toolbelt.middleware import https_safe_api_cors_lang_bench
bottle.install(https_safe_api_cors_lang_bench)# Add static files routes
from toolbelt.routes.static import *# Add social login routes
from toolbelt.routes.social import *# VALIDATE_TOKEN=app.models.validate_token
def validate_token(token):
return User.objects.get(api_key=token)
from toolbelt.auth import token_authenticationfrom toolbelt.main import run
run()MEMFILE_MAX_BYTES=512000 DEBUG=true SERVER=meinheld PORT=3000 python run.py
Your *handlers.py* file:
from toolbelt.requests import p, error_response
@route
def x():
p('my_param', default='__None__')
return error_response('msg', 400)*.env* file (for *autoenv*):
VALIDATE_TOKEN=app.models.validate_token
MEMFILE_MAX_BYTES=512000
DEBUG=true
SERVER=meinheld
PORT=3000
API_URL=http://localhost:8000
STATIC_DIR=./dist
STATIC_INDEX=index.html