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

Welcome!

Python Authors: Elizabeth White, AppDynamics Blog, XebiaLabs Blog, Hovhannes Avoyan, Carmen Gonzalez

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
SYS-CON Events announced today that LeaseWeb USA Inc., one of the world's largest hosting brands, 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. LeaseWeb USA Inc. was established in 2011, a separate and distinct operating entity providing services in the USA. LeaseWeb is a trusted partner to mid-market companies, helping them find the right solution to their critical cloud-hosted needs from our global...
Symantec Corp. has announced the worldwide availability of Encryption Everywhere, a website security package available through web hosting providers. Encryption Everywhere lets web hosting providers integrate encryption into every website from the moment it is created. With the new web security service, hosting providers can offer a variety of flexible options, including basic website encryption included as part of any hosted service, and a number of premium security packages with increasingly s...
“Today’s generation of customers are always connected and well informed, but businesses are lagging behind in terms of both understanding and engaging their customers across all their channels in ways that are both relevant and consistent,” said Brian Walker, chief strategy officer, SAP Hybris. Only one in four companies are enabling omnichannel customer engagement, whereby they have a unified, “single view” of the customer and are delivering a consistent, contextual, and relevant experience a...
Zones, Inc., illustrated how technology solutions can improve patient care at the HIMSS16 Conference and Exhibition. Zones’ healthcare experts showcased technology to enhance patient care, ensure access to electronic medical and health records (EMR/EHR), design and implement mobility initiatives, and safeguard network and data security. Supporting every aspect of IT in the healthcare environment, Zones’ healthcare team can recommend the most productive and scalable IT solutions to ensure a high...
Electric Imp has expanded its focus to align with evolving commercial and industrial Internet of Things (IoT) opportunities. ”As our platform evolves, it is able to satisfy markets more demanding than the initial consumer segment,” said Hugo Fiennes, CEO and co-founder of Electric Imp. "Delivering over 500,000 units through our consumer device partners helped prove the scalability, reliability and usability of our platform, and now we are targeting our unique architecture at the problems facing...
@ThingsExpo has been named the ‘Top WebRTC Influencer' by iTrend. iTrend processes millions of conversations, tweets, interactions, news articles, press releases, blog posts - and extract meaning form them and analyzes mobile and desktop software platforms used to communicate, various metadata (such as geo location), and automation tools. In overall placement, @ThingsExpo ranked as the number one ‘WebRTC Influencer' followed by @DevOpsSummit at 55th.
SYS-CON Events announced today that Chetu Inc., a worldwide leader in custom software solutions for niche businesses, software-defined storage and data services platform, will exhibit at SYS-CON's @ThingsExpo, which will take place on June 7-9, 2016, at the Javits Center in New York City, NY. Founded in 2000, Chetu Inc. is a global provider of customized software development solutions and IT staff augmentation services for software technology providers. By providing clients with unparalleled ni...
Exosite has announced its Taipei Office has formally been established. Exosite’s Taiwan operations have grown from the Taichung team, primarily focused on research and development, into a full-service IoT enablement organization with development and consulting capabilities. The new Taipei office is located in the Taipei Minsheng Dunhua district, surrounded by all its hardware and channel partners. Exosite will devote its time to the Taiwan market and expand its business into the Asia-Pacific mar...
SYS-CON Events announced today BZ Media LLC has been named “Media Sponsor” of SYS-CON's 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. BZ Media LLC is a high-tech media company that produces technical conferences and expositions, and publishes a magazine, newsletters and websites in the software development, SharePoint, mobile development and Commercial Drone markets.
*This is part of a series of blogs examining Sensor-2-Server (S2S) communications, development, security and implementation. For the past two weeks, we’ve taken an in-depth look at what Sensor-2-Server communications are, how to implement these systems, and some of the specific aspects of communication that these systems facilitate. This week, for our final installment, we’ll examine some of the benefits, as well as security considerations, for S2S communications.
As devices, sensors, objects and people are given digital identities that connect them to the Internet by the billions, the need for security and privacy becomes a critical factor for both market adoption and safety. The 40-year-old security methods we now use on our PCs and networks cannot address many of these IoT devices.
Two-thirds of organizations implementing hybrid cloud report they’re already gaining competitive advantage from their hybrid environments and are nearly three times as likely to use it to assemble data assets or monetize data, according to findings released by IBM (NYSE: IBM). With a hybrid cloud approach, organizations can be selective about when to use cloud and when to use traditional IT infrastructure – delivering the best functionality while meeting speed and flexibility needs, as well a...
Internet of Things (IoT) platforms have evolved. Advances in technology make it possible for facilities to become more data-driven by connecting to energy assets, thereby improving building resiliency and reducing energy costs. By creating an Energy Network of Things, facilities can manage energy assets in real-time, institute system-wide operational oversight and compliance, execute energy efficiency programs, utilize real-time data, and support budgeting and asset planning across local and geo...
SYS-CON Events announced today CrowdReviews.com has been named “Media 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. CrowdReviews.com is the first buyer’s guide that ranks products and services based on client reviews.
For basic one-to-one voice or video calling solutions, WebRTC has proven to be a very powerful technology. Although WebRTC’s core functionality is to provide secure, real-time p2p media streaming, leveraging native platform features and server-side components brings up new communication capabilities for web and native mobile applications, allowing for advanced multi-user use cases such as video broadcasting, conferencing, and media recording.
SYS-CON Events announced today Object Management Group® has been named “Media 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.
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. Pythian, a 400-person global IT services company that helps companies compete by adopting disruptive technologies, announced today that CEO Paul Vallée has been named “Diversi...
transform operational efficiency and safety for businesses and communities, especially during critical situations. During these critical events, man-made incidents or natural disasters, identifying and reaching employees with reliable and automated communications can not only protect business assets, but can be the difference between life and death. In his session at @ThingsExpo, Imad Mouline, chief technology officer for Everbridge, will highlight incident communications best practices and ...
Big Data, cloud, analytics, contextual information, wearable tech, sensors, mobility, and WebRTC: together, these advances have created a perfect storm of technologies that are disrupting and transforming classic communications models and ecosystems. In his session at @ThingsExpo, Erik Perotti, Senior Manager of New Ventures on Plantronics’ Innovation team, will provide an overview of this technological shift, including associated business and consumer communications impacts, and opportunities...
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® | @ThingsExpo, which will take place on June 7-9, 2016, at the Javits Center in New York City, NY. iDevices has announced that it has entered into a definitive agreement to sell the world’s #1 app-enabled grilling and cooking thermometer brands, namely iGrill® and Kitchen Thermometer, to Weber-Stephens Products, LLC. Weber®, the world’s lar...
Latest Stories
Cloud Expo & DevOps Summit 2015 West
KEYNOTES
Intellyx
Opening Keynote | Innovation in the Age of Digital Transformation
IBM
Day 2 Keynote | Geek Girls Are Chic: 5 Career Hacks
Octoblu
Day 3 Keynote | How We Built and Scaled an IoT Platform and Business
POWER PANELS
Cloud Expo Power Panel
Cloud Expo Power Panel | Cloud Computing: We Now Live in an API World
DevOps Summit Power Panel
DevOps Summit Power Panel | DevOps Five Years Later: What Does the Future Hold?
IoT Power Panel
@ThingsExpo Power Panel | The World's Many IoTs: Which Are the Most Important?
Cloud Expo & DevOps Summit 2015 East
KEYNOTES
IBM
Opening Keynote | Geek Girls Are Chic: 5 Career Hacks
Cisco
Day 2 Keynote | The Internet of Everything: Seizing the Opportunities
Virtustream
Day 3 Keynote at 16th Cloud Expo | Rodney Rogers, CEO of Virtustream
VENDOR PRESENTATIONS
Akana
General Session at 16th Cloud Expo | Laura Heritage, Director of API Strategy at Akana
CenturyLink
General Session at 16th Cloud Expo | David Shacochis, Vice President at CenturyLink
Cisco
General Session at 16th Cloud Expo | Paul Maravei, Regional Sales Manager, Hybrid Cloud, Cisco
CodeFutures
General Session at 16th Cloud Expo | Dan Lynn, CEO of CodeFutures Corporation
MetraTech, now part of Ericsson
General Session at 16th Cloud Expo | Esmeralda Swartz, VP, Marketing Enterprise & Cloud at Ericsson
SoftLayer
General Session at 16th Cloud Expo | Phil Jackson, Lead Technology Evangelist at SoftLayer
MetraTech, now part of Ericsson
General Session at 16th Cloud Expo | Esmeralda Swartz, VP, Marketing Enterprise & Cloud at Ericsson
Windstream
General Session at 16th Cloud Expo | Michael Piccininni, EMC, & Mike Dietze, Windstream
POWER PANELS
Cloud Expo Power Panel
Cloud Expo Power Panel | The Evolving Cloud: Where Are We Today?
DevOps Summit Power Panel
DevOps Summit Power Panel | Balancing the Three Pillars of DevOps
IoT Power Panel
@ThingsExpo Power Panel | The Internet of Things: A New Age
Microservices & IoT Power Panel
Microservices & IoT Power Panel at DevOps Summit
VIEW KEYNOTE WEBCASTS
Microsoft
Microsoft Opening Keynote | NoOps != No Operations
Qubell
DevOps Summit Keynote | Purpose-Defined Computing: The Next Frontier in Automation
PLATINUM SPONSORS
Verizon Enterprise
General Session | Verizon Pay-As-You-Go Model for Oracle Database Licenses Means Costs Savings and Business Benefits
Verizon Digital Media Services
Creating a Faster, More Secure Cloud
GOLD SPONSORS
Cisco
General Session | [Podcast] Hybrid Cloud – Different Clouds for Different Needs
SAP
General Session | Innovation with Cloud and Big Data Solutions That Will Revolutionize Your Business – Join SAP and Partners
SoftLayer
General Session | How to Architect and Optimize Your Cloud for Consistent Performance
Power Panels