Skip to main content

A RESTful extention on Tornado. Mingcai SHEN <archsh@gmail.com>

Project description

Express Extension for Tornado
======================

**A RESTful extension for tornado.**

*Note: It's under very basic development now, every thing can be changed in the next commit.*

Features
----------------------
1. XXX
1. XXXX
1. XXXX
1. XXXX
1. XXXX

Quick Start
----------------------

# -*- coding: utf-8 -*-
from torexpress.application import ExpressApplication
from torexpress.handler import ExpressHandler
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, Sequence, MetaData, ForeignKey
from sqlalchemy.orm import relationship, backref
from sqlalchemy.orm.query import Query

Base = declarative_base()

class User(Base):
__tablename__ = 'users'
id = Column(Integer, Sequence('user_id_seq'), primary_key=True)
name = Column(String(50), nullable=False, unique=True)
fullname = Column(String(50), nullable=True)
password = Column(String(40), nullable=True)

class UserHandler(ExpressHandler):
"""UserHandler to process User table."""

class Meta:
table = User

@encoder('password')
def password_encoder(self, passwd, inst=None):
import hashlib
return hashlib.new('md5', passwd).hexdigest()

if __name__ == "__main__":
import tornado.ioloop
application = ExpressApplication([UserHandler.route_to('/users'), ],
dburi='sqlite:///:memory:', loglevel='DEBUG', debug=True)
Base.metadata.create_all(application.db_engine)
application.listen(8888)
tornado.ioloop.IOLoop.instance().start()


Requirements
----------------------

- Tornado >= 3.1.1
- SQLAlchemy >= 0.8
- Simplejson
- PyYAML

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tornado-torexpress-0.1.5.tar.gz (19.8 kB view details)

Uploaded Source

File details

Details for the file tornado-torexpress-0.1.5.tar.gz.

File metadata

File hashes

Hashes for tornado-torexpress-0.1.5.tar.gz
Algorithm Hash digest
SHA256 aef47c03a16e703b2942e5a0aac147f86fd6cd3079097884b6f9e4a7f18a3e90
MD5 8747d0c5f144343c54064d5f261ff962
BLAKE2b-256 6386e2675bb69c9ca24db795a4a5eba3886cc74d0690716b736f55f989e19d13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page