Pybald¶
Pybald is an MVC style web framework written in Python. It is inspired by work done by Ian Bicking, and builds upon the concepts presented in Another do-it-yourself framework. It also takes some design inspiration from Ruby on Rails, Django, and Flask.
A Small Pybald Application¶
import pybald
from pybald import context
from pybald.core.controllers import Controller, action
from pybald.core.router import Router
# configure our pybald application
pybald.configure(default=True)
def map(urls):
urls.connect('home', r'/', controller='home')
class HomeController(Controller):
@action
def index(self, req):
return "Hello!"
app = Router(routes=map, controllers=[HomeController])
if __name__ == "__main__":
context.start(app)
This mini application illustrates many of the core concepts present in most Pybald applications. These include: configuring an application and the pybald context, setting up URL routes via a mapping function, creating a controller class with a a handler using the action decorator and finally setting up a WSGI pipeline using the pybald Router. Each of these topics will be covered in more detail in the following documentation.
Other core concepts like templating, data persistence and models will be also be covered later.
Contents¶
Indices and tables¶
Dependencies¶
Pybald works with Python 2.7 and Python 3 verions above and including 3.5.
Pybald currently depends on, and will automatically install, the following libraries:
These libraries are well tested and generally very well documented. When expanding beyond the simplest use cases presented in this documentation, you can dive deeper and access more functionality by exploring each library’s individual docs.
License¶
Pybald is distributed under the MIT license.
The MIT License
Copyright (c) 2013-2017 Michael Kowalchik, TenZeroLab
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
The following software may be included in this product:
Django Paginator (django.core.paginator); Use of any of this software is
governed by the terms of the license below:
Copyright (c) Django Software Foundation and individual contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of Django nor the names of its contributors may be used
to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.