The Wayback Machine - https://web.archive.org/web/20171220135634/http://python.sys-con.com:80/node/3648788

Welcome!

Python Authors: Matt Davis, AppDynamics Blog, Pat Romanski, Donald Meyer, Liz McMillan

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
Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
"Akvelon is a software development company and we also provide consultancy services to folks who are looking to scale or accelerate their engineering roadmaps," explained Jeremiah Mothersell, Marketing Manager at Akvelon, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
"Space Monkey by Vivent Smart Home is a product that is a distributed cloud-based edge storage network. Vivent Smart Home, our parent company, is a smart home provider that places a lot of hard drives across homes in North America," explained JT Olds, Director of Engineering, and Brandon Crowfeather, Product Manager, at Vivint Smart Home, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Large industrial manufacturing organizations are adopting the agile principles of cloud software companies. The industrial manufacturing development process has not scaled over time. Now that design CAD teams are geographically distributed, centralizing their work is key. With large multi-gigabyte projects, outdated tools have stifled industrial team agility, time-to-market milestones, and impacted P&L; stakeholders.
"IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
"Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
Gemini is Yahoo’s native and search advertising platform. To ensure the quality of a complex distributed system that spans multiple products and components and across various desktop websites and mobile app and web experiences – both Yahoo owned and operated and third-party syndication (supply), with complex interaction with more than a billion users and numerous advertisers globally (demand) – it becomes imperative to automate a set of end-to-end tests 24x7 to detect bugs and regression. In th...
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
"There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
WebRTC is great technology to build your own communication tools. It will be even more exciting experience it with advanced devices, such as a 360 Camera, 360 microphone, and a depth sensor camera. In his session at @ThingsExpo, Masashi Ganeko, a manager at INFOCOM Corporation, introduced two experimental projects from his team and what they learned from them. "Shotoku Tamago" uses the robot audition software HARK to track speakers in 360 video of a remote party. "Virtual Teleport" uses a multip...
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
SYS-CON Events announced today that Evatronix will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Evatronix SA offers comprehensive solutions in the design and implementation of electronic systems, in CAD / CAM deployment, and also is a designer and manufacturer of advanced 3D scanners for professional applications.
Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...