The quick and easy generative Webframework for python. Completely rewritten from scratch. Ready to go!


pip install pythononwheels

Watch the new Intro video
(fullscreen to see the command line best)

Follow on twitter for updates: You can check the current state on github: Star . This is also the one serving this site.

Everything you need on board. Batteries included.

PythonOnWheels is a generative, Rapid Application Development, non intrusive web framework for python. With PythonOnWheels you need no extra tools to start. Everything from DB to Webserver and template engine is included. But you are not forced to use them and can go raw or include your own tools whenever you want.

Based on a very Strong foundation:



Probably the most simple SQL relations out there! Based on sqlalchemy.

With PythonOnWheels you simply add a class decorator like @relation.has_many("comments") to the model (in this example a Post model) and every Post can have comments. It will be automatically mapped to the DB (SQLite, Postgres, MySQL, MariaDb, Oracle, MSSQL ...) and to all related comment Models.

class Post(Base):
      # Alll your model code below here ..

Supported relation types are:

  • @relation.has_many("comments")(decorated class has many comments.)
  • @relation.many_to_many("comments")(decorated class has many to many with comments)
  • @relation.belongs_to("comments")(decorated class belongs to comments.)
  • @relation.one_to_one("comments")(decorated class has one to one with comments)
  • @relation.tree() (decorated class has adjacence list (is a tree))

For details see sqlalchemy relation documentation

All pow models (SQL or NoSQL) use a cerberus schema as definition. This means you have validation on board for every model and you can easily switch from SQL to NoSQL

  • the @relation.setup_schema() decorator will map this schema to a vaild sqlalchemy (or specific NoSQL) column definition set.
  • SQL only: model will also automatically get all the right Foreign_Keys and python attributes to create a has_many relationship to the comments model. This is all done for you with the @relation.has_many("comments")

class Post(Base):
      # Schema definition with the new (cerberus) schema style 
      # which offer you immediate validation 
      schema = {
          # string sqltypes can be TEXT or UNICODE or nothing
          'author': {'type': 'string', 'maxlength' : 35},
          'title' : {'type': 'string', "required" : True},
          'text'  : {'type': 'string'},
          'votes' : {'type': 'integer'},
          'status': {'type': 'string', "allowed" : ["backlog", "wip", "done"] },

      # init
      def __init__(self, **kwargs):

      # your methods down here



Probably the most simple RESTrouting out there! One decorator. Done!

With PythonOnWheels you simply add a class decorator like @app.add_rest_routes("basename") to your handler and you get all the typical REST routes mapped to the according CRUD methods of your handler class.

By the way: this is what generate_handler generates for you.

class commentHandler(BaseHandler):

# every pow handler automatically gets these RESTful routes
# thru the @app.add_rest_routes() decorator.
# 1  GET    /comment        #=> index
# 2  GET    /comment/1      #=> show
# 3  GET    /comment/new    #=> new
# 4  GET    /comment/1/edit #=> edit 
# 5  GET    /comment/page/1 #=> page
# 6  GET    /comment/search #=> search
# 7  PUT    /comment/1      #=> update
# 8  POST   /comment        #=> create
# 9  DELETE /comment/1      #=> destroy

# standard supported http methods are:
# you can overwrite any of those directly or leave the 
# @add_rest_routes out to have a basic handler.

def show(self, id=None):
    self.success(message="Comment show", data=res.json_dump())

def index(self):
    res = m.find_all(as_json=True)
    self.success(message="Comment, index", data=res)         

def page(self, page=0):
    if database["type"] == "sqlite":
    res = m.find_all(as_json=True, 
    self.success(message="Comment page: #" +str(page), data=res )  

def edit(self, id=None):
    self.success(message="Comment, edit id: " + str(id))

def new(self):
    self.success("Comment, new")

def create(self):
    self.success(message="Comment, create")

def update(self, id=None):
    self.success("Comment, update id: " + str(id))

def destroy(self, id=None):
    self.success("Comment, destroy id: " + str(id))

Direct routes Flask like direct routes included as well. I Think Flask/Werkzeug routing is the best direct routing out there.

Additionally you can set direct routes by simply adding the class decorator: @app.add_route("/"). This will then call the default HTTP methods of your handler (GET=get, PUT=put ...)

class TestHandler(BaseHandler):
    # on HTTP GET this method will be called.
    def get(self):
        self.write("Hello world!")

You can also specify more precisely which method to call for each HTTP VERB using the dispatch parameter.

@app.add_route("/test/([0-9]+)*", dispatch={"get" : "test"})
class TestHandler(BaseHandler):
    # on HTTP GET this method will be called.
    def test(self, index=None):

Use: @app.add_route("/test/([0-9]+)*", dispatch={"get" : "test"}) to add a direct route: matching the regular expression : /test/([0-9+]) and then calling the given method of your handler class. The regex group ([0-9+]) will be handed as the first parameter to test(self, index)



And finally: a super easy workflow. Quick to start and all the basics on board:

  • generative approach (but not noisy)
    • generate_app
    • generate_models script
    • generate_migrations script
    • generate_handlers (handler are controllers)
  • super easy relations with decorators @relations.has_many("comments")
    • @has_many(), @has_one(), @one_to_one(), @tree()
    • All the rest including foreign_keys, virtual python attributes are injected for you.
  • super easy REST routing with decorators @app.add\_restful\_routes(),
    • @app.add_rest_routes("base_route")
  • flask like routing decorator @app.add_route(route)
    • @app.add_route("route")
  • db migrations autogenerated using alembic in the back
    • generate_migration, update_db
  • validation on board with cerberus schemas
    • model.validate() => executes cerberus validator

    I call it "SQUEEZY" = Simlpe Quick and Easy ;)