The Wayback Machine - https://web.archive.org/web/20160214054424/http://java.sys-con.com/node/3648788

Welcome!

Java IoT Authors: Blue Box Blog, Pat Romanski, Elizabeth White, SmartBear Blog, Charlotte Spencer-Smith

Related Topics: @DevOpsSummit, Java IoT, Python

@DevOpsSummit: Blog Feed Post

An Introduction to Python Frameworks – Part 1 By @OmedHabib | @DevOpsSummit #DevOps

Today, there is a wide variety of Python frameworks that make creating web applications much easier

An Introduction to Python Frameworks - Part 1
By Omed Habib

Python began life in the late 1980s. It was developed by Guido van Rossum at Centrum Wiskunde & Informatica, a math and computer science research center in Amsterdam Science Park in the Netherlands. Van Rossum continues to be an influential figure in the development and guidance of Python. In fact, members of the Python community have bestowed upon him the regal title of Benevolent Dictator for Life (BDFL).

From those humble beginnings, Python has grown to become one of the most popular server-side languages on the Internet. According to W3Techs, it is used by more high-traffic sites than ColdFusion, PHP, and ASP.NET. More than 98 percent of those sites are running Python 2.0, and just over one percent are using 3.0.

Frameworks Makes Life Easier
Today, there is a wide variety of Python frameworks that make creating web applications much easier. These frameworks bring together the modules and packages that allow you to build applications quickly, without the need to take care of involved details, like sockets and protocols, all in one place.

In Part 1 of this two-part article series, we will examine some of the more popular Python frameworks. While most modern Web frameworks are used on the server, some are beginning to incorporate code that lets them run code on the client (e.g., Skulpt or Trinket). Python frameworks are often separated into full-stack and non-full-stack frameworks. Full-stack frameworks help developers create applications from the user experience right through to the database. Non-full-stack frameworks are those that handle anything less than complete development.

There are also micro-frameworks, which are non-full-stack frameworks less bloat. In some situations, it makes more sense to use a complement of micro-frameworks, while other applications demand a full stack. We will take a closer look at full-stack vs. micro-frameworks in Part 2 of this series.

Django
Perhaps the Python framework with the highest profile is Django. It is an open-source framework that follows the architectural pattern of model-view-controller (MVC). It is named after Django Reinhardt, a French composer and guitarist who is widely considered one of the greatest guitar players in history. Two developers at the Lawrence Journal-World in Lawrence, Kansas, Adrian of Holovaty and Simon Willison, created Django in 2003 to build Web apps for the newspaper.

Django includes its own templating engine, as well as providing OOTB support for the widely popular Jinja2 engine. It also employs a regex based URL dispatcher, allowing complex mappings with very simple URLs.

One of Django's strengths has been that it is a single package install. Other alternatives require developers to hunt down many components just to get started. Also, Django always had extensive documentation, historically a weakness for open-source projects. It is a robust, well-integrated framework with many plug-ins and add-ons from the user community. Also, the community behind the project seems much more organized, as is evident with its thorough documentation and tutorials.

TurboGears
TurboGears
is a framework built on top of several reputable Python projects, such as SQLAlchemy, WebOb, Repoze, and Genshi. In a sense, TurboGears takes the approach of gluing together already established open platforms. Like Django, it utilizes the MVC architecture. It recently also incorporated a "minimal mode," which allows it to act as a micro-framework.

TurboGears was developed by Kevin Dangoor in 2005. He distributed it as an open-source project in September of that year. In 2013, the project developers moved to support Python 3 and away from the Pylons code base they had been working with. Some of the advantages of TurboGears include:

  • Strong support for aggregates
  • Powerful object relational mapper
  • Transaction system that takes care of multi-database transactions automatically
  • Multi-database support
  • Reusable snippets for templates
  • Lots of flexibility to incorporate non-standard components
  • Support for sharding
  • Template systems that make life easier for designers

A few of the drawbacks of TurboGears includes a very basic admin, fewer third-party apps, and rudimentary documentation. A major challenge with TurboGears is that it can be overwhelming. Because it is mash-up of other components that offer infinite flexibility, it can be overwhelming when trying to decide which path to take to complete a task.

web2py
One open-source framework, web2py, allows developers to create dynamic, interactive websites quickly. It is designed to eliminate many of the repetitive programming tasks that slow down development, like creating basic forms. In the beginning, it was created as a teaching tool. It was modeled after Django and Ruby on Rails, a framework for the Ruby language. Like TurboGears, it uses the MVC architecture.

The original source code was released in 2007 by Massimo DiPierro. At that time, it was known as the Enterprise Web Framework (EWF). Due to naming conflicts, it changed names several times and settled on web2py on Version 1.16. Several applications created using web2py include the Movuca Content Management System, music site NoobMusic, a diagnostic tool for networks called LinkFindr and the Instant Press blogging platform. In 2011, web2py captured a Bossie Award for the best open-source development software. The following year, its winning ways continued when it brought home InfoWorld's Technology of the Year award.

Like Django, web2py has extensive documentation. New and advanced developers alike can download the Complete Reference Manual for free.

Some of web2py's advantages include:

  • Easy to use. As a robust full-stack framework, it functions without any dependencies. This makes it easy to learn and deploy, as no configuration files are needed for installation. Once it is downloaded and installed, everything works. Developers get a database, a Web-based IDE, and a Web server as well as a powerful API with a number of core objects.
  • Excellent security. Web2py's template language reduces the dangers of hackers using cross-site scripting. The abstraction layer prevents SQL injections while the forms created have field validation and stop cross-site request forgeries. Sessions are stored on the server to keep bad actors from messing with browser cookies, and every password is stored hashed.

Some drawbacks to web2py include:

  • Not easy to use the administrative interface on a regular basis
  • No permissions on the administrative interface
  • No built-in unit testing support
  • Rapid development. All functions have default behaviors. Forms are generated automatically, and high-level widgets and application grids are built in.

Flask
Flask is a Python micro-framework based on Jinja2 and Werkzeug. Similar to other frameworks, it is licensed under the Berkeley Software Distribution (BSD), a free software license that operates with few restrictions. Web sites that have used Flask include LinkedIn and Pinterest. It includes features such as:

  • Built-in unit testing support
  • Templating using Jinja2
  • Extensive documentation
  • Client-side sessions using secure cookies
  • Development server and debugger
  • RESTful request dispatching
  • Compliant with WSGI version 1.0
  • Unicode based
  • Numerous extensions

Flask is a young framework that came on the scene in 2010. The philosophical objective of Flask is to not impose conventions on the programmer, allowing you to use your choice of DB ORM, templating engine, session middleware, or other components that your project requires. This is generally, in my opinion, the purpose of a ‘microframework'.

I would say that a framework like Flask is better suited to a more experienced developer, not necessarily just to smaller applications. Of course, if you just want to make a simple REST API, then Flask is definitely good bet.

Bottle
Like Flask, Bottle is a WSGI Web framework. Distributed as a single file, it does not have any dependencies outside of the Python Standard Library. Written by Marcel Hellkamp in 2009, it has minimal tools to start including templating, routing and a WSGI abstraction layer. This small, powerful framework is great for programmers looking for flexibility and basic functionality, building simple applications and websites and creating a Web API.

Its advantages include:

  • Fast template engine that comes built-in and supports Jinja2, Mako, and Cheetah
  • Many utilities that can access uploads, cookies, form data, headers, and other metadata
  • HTTP development server built-in that supports fapws3, Google App Engine, CherryPy and Paste
  • Support for dynamic URLs

Another advantage of Bottle is that its small profile makes it easy to embed it within a larger application without worrying about system-wide dependencies. Bottle is for you if you want to create small apps with a simple, clean and fast framework that is not verbose.

Multiple Frameworks
It is hard to believe, but these are just a few of the dozens of Python frameworks available to developers. Python.org reports that Django, TurboGears, and web2py are the most popular full-stack options. Here we added two of the higher-profile micro-frameworks to provide a thorough look at the framework landscape. Other frameworks with enthusiastic followers include Pyramid, web.py, Bobo, Albatross and CherryPy.

Finding the Right Fit
Choosing the right framework depends on the size of the project, its communication needs, whether it is a standalone application or not, the level of customization that is needed, overhead and a number of other factors. Just as important, it depends on which framework feels right for your personal working style. Review these projects and download their latest release. Take a test drive to make sure you are in the right vehicle before planning a major trip.

The post An Introduction to Python Frameworks - Part 1 appeared first on Application Performance Monitoring Blog | AppDynamics.

Read the original blog entry...

More Stories By AppDynamics Blog

In high-production environments where release cycles are measured in hours or minutes — not days or weeks — there's little room for mistakes and no room for confusion. Everyone has to understand what's happening, in real time, and have the means to do whatever is necessary to keep applications up and running optimally.

DevOps is a high-stakes world, but done well, it delivers the agility and performance to significantly impact business competitiveness.

@ThingsExpo Stories
With the Apple Watch making its way onto wrists all over the world, it’s only a matter of time before it becomes a staple in the workplace. In fact, Forrester reported that 68 percent of technology and business decision-makers characterize wearables as a top priority for 2015. Recognizing their business value early on, FinancialForce.com was the first to bring ERP to wearables, helping streamline communication across front and back office functions. In his session at @ThingsExpo, Kevin Roberts...
Cognitive Computing is becoming the foundation for a new generation of solutions that have the potential to transform business. Unlike traditional approaches to building solutions, a cognitive computing approach allows the data to help determine the way applications are designed. This contrasts with conventional software development that begins with defining logic based on the current way a business operates. In her session at 18th Cloud Expo, Judith S. Hurwitz, President and CEO of Hurwitz & ...
One of the bewildering things about DevOps is integrating the massive toolchain including the dozens of new tools that seem to crop up every year. Part of DevOps is Continuous Delivery and having a complex toolchain can add additional integration and setup to your developer environment. In his session at @DevOpsSummit at 18th Cloud Expo, Miko Matsumura, Chief Marketing Officer of Gradle Inc., will discuss which tools to use in a developer stack, how to provision the toolchain to minimize onboa...
With an estimated 50 billion devices connected to the Internet by 2020, several industries will begin to expand their capabilities for retaining end point data at the edge to better utilize the range of data types and sheer volume of M2M data generated by the Internet of Things. In his session at @ThingsExpo, Don DeLoach, CEO and President of Infobright, will discuss the infrastructures businesses will need to implement to handle this explosion of data by providing specific use cases for filte...
SYS-CON Events announced today that Avere Systems, a leading provider of enterprise storage for the hybrid cloud, will exhibit at SYS-CON's 18th International Cloud Expo®, which will take place on June 7-9, 2016, at the Javits Center in New York City, NY. Avere delivers a more modern architectural approach to storage that doesn’t require the overprovisioning of storage capacity to achieve performance, overspending on expensive storage media for inactive data or the overbuilding of data centers ...
SYS-CON Events announced today that Pythian, a global IT services company specializing in helping companies adopt disruptive technologies to optimize revenue-generating systems, has been named “Bronze Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2015 at the Javits Center in New York, New York. Founded in 1997, Pythian is a global IT services company that helps companies compete by adopting disruptive technologies such as cloud, Big Data, advanced analytics, and DevO...
SYS-CON Events announced today that Commvault, a global leader in enterprise data protection and information management, has been named “Bronze Sponsor” of SYS-CON's 18th International Cloud Expo, which will take place on June 7–9, 2016, at the Javits Center in New York City, NY, and the 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Commvault is a leading provider of data protection and information management...
The Quantified Economy represents the total global addressable market (TAM) for IoT that, according to a recent IDC report, will grow to an unprecedented $1.3 trillion by 2019. With this the third wave of the Internet-global proliferation of connected devices, appliances and sensors is poised to take off in 2016. In his session at @ThingsExpo, David McLauchlan, CEO and co-founder of Buddy Platform, will discuss how the ability to access and analyze the massive volume of streaming data from mil...
SYS-CON Events announced today that Alert Logic, Inc., the leading provider of Security-as-a-Service solutions for the cloud, will exhibit at SYS-CON's 18th International Cloud Expo®, which will take place on June 7-9, 2016, at the Javits Center in New York City, NY. Alert Logic, Inc., provides Security-as-a-Service for on-premises, cloud, and hybrid infrastructures, delivering deep security insight and continuous protection for customers at a lower cost than traditional security solutions. Ful...
SYS-CON Events announced today that Interoute, owner-operator of one of Europe's largest networks and a global cloud services platform, has been named “Bronze Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2015 at the Javits Center in New York, New York. Interoute is the owner-operator of one of Europe's largest networks and a global cloud services platform which encompasses 12 data centers, 14 virtual data centers and 31 colocation centers, with connections to 195 ad...
SYS-CON Events announced today that Men & Mice, the leading global provider of DNS, DHCP and IP address management overlay solutions, will exhibit at SYS-CON's 18th International Cloud Expo®, which will take place on June 7-9, 2016, at the Javits Center in New York City, NY. The Men & Mice Suite overlay solution is already known for its powerful application in heterogeneous operating environments, enabling enterprises to scale without fuss. Building on a solid range of diverse platform support,...
Fortunately, meaningful and tangible business cases for IoT are plentiful in a broad array of industries and vertical markets. These range from simple warranty cost reduction for capital intensive assets, to minimizing downtime for vital business tools, to creating feedback loops improving product design, to improving and enhancing enterprise customer experiences. All of these business cases, which will be briefly explored in this session, hinge on cost effectively extracting relevant data from ...
WebSocket is effectively a persistent and fat pipe that is compatible with a standard web infrastructure; a "TCP for the Web." If you think of WebSocket in this light, there are other more hugely interesting applications of WebSocket than just simply sending data to a browser. In his session at 18th Cloud Expo, Frank Greco, Director of Technology for Kaazing Corporation, will compare other modern web connectivity methods such as HTTP/2, HTTP Streaming, Server-Sent Events and new W3C event APIs ...
SYS-CON Events announced today that iDevices®, the preeminent brand in the connected home industry, will exhibit at SYS-CON's 18th International Cloud Expo®, which will take place on June 7-9, 2016, at the Javits Center in New York City, NY. iDevices, the preeminent brand in the connected home industry, has a growing line of HomeKit-enabled products available at the largest retailers worldwide. Through the “Designed with iDevices” co-development program and its custom-built IoT Cloud Infrastruc...
Companies can harness IoT and predictive analytics to sustain business continuity; predict and manage site performance during emergencies; minimize expensive reactive maintenance; and forecast equipment and maintenance budgets and expenditures. Providing cost-effective, uninterrupted service is challenging, particularly for organizations with geographically dispersed operations.
There will be new vendors providing applications, middleware, and connected devices to support the thriving IoT ecosystem. This essentially means that electronic device manufacturers will also be in the software business. Many will be new to building embedded software or robust software. This creates an increased importance on software quality, particularly within the Industrial Internet of Things where business-critical applications are becoming dependent on products controlled by software. Qua...
Join us at Cloud Expo | @ThingsExpo 2016 – June 7-9 at the Javits Center in New York City and November 1-3 at the Santa Clara Convention Center in Santa Clara, CA – and deliver your unique message in a way that is striking and unforgettable by taking advantage of SYS-CON's unmatched high-impact, result-driven event / media packages.
As enterprises work to take advantage of Big Data technologies, they frequently become distracted by product-level decisions. In most new Big Data builds this approach is completely counter-productive: it presupposes tools that may not be a fit for development teams, forces IT to take on the burden of evaluating and maintaining unfamiliar technology, and represents a major up-front expense. In his session at @BigDataExpo at @ThingsExpo, Andrew Warfield, CTO and Co-Founder of Coho Data, will dis...
Silver Spring Networks, Inc. (NYSE: SSNI) extended its Internet of Things technology platform with performance enhancements to Gen5 – its fifth generation critical infrastructure networking platform. Already delivering nearly 23 million devices on five continents as one of the leading networking providers in the market, Silver Spring announced it is doubling the maximum speed of its Gen5 network to up to 2.4 Mbps, increasing computational performance by 10x, supporting simultaneous mesh communic...
Eighty percent of a data scientist’s time is spent gathering and cleaning up data, and 80% of all data is unstructured and almost never analyzed. Cognitive computing, in combination with Big Data, is changing the equation by creating data reservoirs and using natural language processing to enable analysis of unstructured data sources. This is impacting every aspect of the analytics profession from how data is mined (and by whom) to how it is delivered. This is not some futuristic vision: it's ha...