EXPERIENCES MOVING FROM DJANGO TO FLASK

Similar documents
Django-Style Flask. Cody Lee SCALE12x Feb 22, git clone

Signals Documentation

Quick housekeeping Last Two Homeworks Extra Credit for demoing project prototypes Reminder about Project Deadlines/specifics Class on April 12th Resul

CIS192 Python Programming

Flask Web Development Course Catalog

Django Test Utils Documentation

ITP 140 Mobile Technologies. Mobile Topics

Biffy: The Batteries-Included Flask-based Framework Documentation

Tomasz Szumlak WFiIS AGH 23/10/2017, Kraków

Without Django. applying django principles to non django projects

Bambu API Documentation

Developer Internship Opportunity at I-CC

Software Test Plan Version 1.0

Byte Academy. Python Fullstack

CIS192 Python Programming

Introduction. Installation. Version 2 Installation & User Guide. In the following steps you will:

Views for Developers. What is Views? (and data geeks) "a tool for making lists of stuff" Bec White DrupalCamp WI, July 2010

29-27 May 2013 CERN WEB FRAMEWORKS. Adrian Mönnich

Building a Django Twilio Programmable Chat Application

Data Management CS 4720 Mobile Application Development

Geospatial three amigos: Python, Leaflet, and ElasticSearch. Roberto Rosario

Azure Developer Immersions API Management

Technology modeling. Ralf Lämmel Software Languages Team University of Koblenz-Landau

DJANGO THE PYTHON WEB FRAMEWORK

Documenting APIs with Swagger. TC Camp. Peter Gruenbaum

Hue Application for Big Data Ingestion

About the Tutorial. Audience. Prerequisites. Disclaimer & Copyright. Django

Overview of BC Learning Network SMS2 Introduction

Smart Bulk SMS & Voice SMS Marketing Script with 2-Way Messaging. Quick-Start Manual

Django with Python Course Catalog

DreamFactory Security Guide

Joomla Basics Series: Joomla Overview

Shortcake. Bridging the gap between WordPress developers and content creators. Brian DeConinck. NC State University. Office of Information Technology

Hello, welcome to creating a widget in MyUW. We only have 300 seconds, so let s get going.

To Kill a Monolith: Slaying the Demons of a Monolith with Node.js Microservices on CloudFoundry. Tony Erwin,

djangotribune Documentation

Web-based ios Configuration Management

Reminders. Full Django products are due next Thursday! CS370, Günay (Emory) Spring / 6

L.A.M.P. Stack Part I

CS193X: Web Programming Fundamentals

Graphene Documentation

nacelle Documentation

What is Standard APEX? TOOLBOX FLAT DESIGN CARTOON PEOPLE

Let's talk about QRadar Apps: Development & Troubleshooting IBM SECURITY SUPPORT OPEN MIC

Destiny Vault Raider. Allyn Hunt Blog: AllynH.com Web application: DestinyVaultRaider.com

HOW TO FLASK. And a very short intro to web development and databases

Distributed Architectures & Microservices. CS 475, Spring 2018 Concurrent & Distributed Systems

Connexion Documentation

CS50 Quiz Review. November 13, 2017

django-sendgrid-events Documentation

Develop Mobile Front Ends Using Mobile Application Framework A - 2

CS 1110, LAB 1: PYTHON EXPRESSIONS.

<?php function preprocess_drupalcon($presentation) { if ($drupal && $ionic) { if ($ionic[ app ] = Megalomaniac ) { create $presentation } } }?

Digital Marketing Manager, Marketing Manager, Agency Owner. Bachelors in Marketing, Advertising, Communications, or equivalent experience

Simplicity and minimalism in software development

AirBespoke Inventory Tracking System

GETTING STARTED GUIDE

neo4django Documentation

Building modern enterprise applications from scratch: lessons learned DOAG 2014 Dr. Clemens Wrzodek

Unifer Documentation. Release V1.0. Matthew S

Building Web Applications

web.py Tutorial Tom Kelliher, CS 317 This tutorial is the tutorial from the web.py web site, with a few revisions for our local environment.

USER MANUAL. SEO Suite TABLE OF CONTENTS. Version: 1.4

welcome to BOILERCAMP HOW TO WEB DEV

django-embed-video Documentation

django-embed-video Documentation

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Laravel

Smashing Node.JS: JavaScript Everywhere

AN IPHONE-PYTHON LOVE AFFAIR. Building APIs for Mobile

Pro Events. Functional Specification. Name: Jonathan Finlay. Student Number: C Course: Bachelor of Science (Honours) Software Development

EmberJS A Fitting Face for a D8 Backend. Taylor Solomon

Masters in Web Development

Nbconvert Refactor Final 1.0

Client Side JavaScript and AJAX

Investigating Source Code Reusability for Android and Blackberry Applications

Django urls Django Girls Tutorial

The Pyramid Web Application Development Framework

Accelerating Information Technology Innovation

The Rise of Open Source Software

Flask Slither Documentation

Meet our Example Buyer Persona Adele Revella, CEO

"Stupid Easy" Scaling Tweaks and Settings. AKA Scaling for the Lazy

Lifehack #1 - Automating Twitter Growth without Being Blocked by Twitter

uick Start Guide 1. Install Oracle Java SE Development Kit (JDK) version or later or 1.7.* and set the JAVA_HOME environment variable.

BaasBox. Open Source Backend as a Service. Otto Hylli

django-embed-video Documentation

Flask-Assets Documentation

Big Data Infrastructure at Spotify

Project Specification - Daily Deals

Flask-Testing Documentation

CSCI 1320 Creating Modern Web Applications. Content Management Systems

Lessons learned from real-world deployments of Java EE 7. Arun Gupta, Red

Building Scalable Web Apps with Python and Google Cloud Platform. Dan Sanderson, April 2015

Cassandra, MongoDB, and HBase. Cassandra, MongoDB, and HBase. I have chosen these three due to their recent

Distributed Systems. 25. Authentication Paul Krzyzanowski. Rutgers University. Fall 2018

LECTURE 14. Web Frameworks

The NoSQL movement. CouchDB as an example

The State of Python. and the web. Armin Ronacher

Patrick Cheung. PopVote backend developer

PROFESSIONAL. NoSQL. Shashank Tiwari WILEY. John Wiley & Sons, Inc.

Transcription:

EXPERIENCES MOVING FROM DJANGO TO FLASK DAN O BRIEN, VP OF ENGINEERING CRAIG LANCASTER, CTO Jana Mobile Inc. www.jana.com

WHO WE ARE Jana is a startup company in Boston connecting advertising and marketing companies to consumers in emerging markets. Via connections to cell phone carriers and vendors, Jana has the capability to send money to most of humanity. We consider ourselves primarily a technology company; mostly engineers (~15/30) Continuous delivery! Cassandra! We re hiring! http://www.jana.com/about/careers/ 2

OUR DJANGO EXPERIENCE: CONDUIT LABS AND MUSIC PETS We both worked at Conduit Labs in 2009-10, where (the now defunct) Music Pets was developed using Django 1.0 This was just when Django 1.0 was coming out Supported ~100k daily users with a very high write-to-read ratio on the database (~1:2) Used a MySQL backend with Django s ORM Django has come a long way since then for example, the test framework stuff is new, and looks great. 3

OUR FLASK EXPERIENCE: JANA AND MCENT We both now work at Jana! Consumer-facing web site (~1M page views/day) Consumer-facing Android app (~1M page views/day) Talks to a JSON REST API Backend process for mobile carrier/vendor communication via REST Internal-use web sites NoSQL backend Mixed use of CouchDB, Cassandra, redis, Hadoop, MySQL 4

WHAT FLASK IS Django and Flask are trying to solve different problems Flask is a simple, lightweight solution to a proper subset of Django s functionality: Ability to map URLs to functions (including managing requests, responses, headers, etc) HTML template rendering creating html responses based on variable values If you re just making a REST API, you might not even need the second thing. 5

DJANGO URL mapping Template rendering! Model Architecture / ORM User & admin management Admin site Test framework! Plugin Architecture 6

FLASK URL mapping Template rendering (Jinja2)! Plugin Architecture! Of note: the model architecture is decoupled from the web framework it s an entirely separate tool in the toolbox. 7

STARTING SMALL: THE SIMPLE FLASK APP A Flask app can be just one.py file I don t have to understand the difference between a project and and an app to get started. I don t need a lot of files that I am not yet using. Adding new endpoints means editing one file. 8

STARTING SMALL: THE SIMPLE DJANGO APP Compare that with the simple Django app: Create project Create app Edit views.py in one directory Edit urls.py in another directory While none of us aspire to build Hello, World, there is something to be said for starting small and building out the architecture as needed. 9

A SLIGHTLY LARGER EXAMPLE https://github.com/jana-mobile/nanoblog The model class stands alone; it doesn t import any code from, say, flask. It can use whatever python libraries are appropriate for its functionality in these cases, sqlalchemy and redis. This is a somewhat simple & silly example, but it s a typical pattern for flask apps. If more models were added, we may want to further abstract away the storage mechanism sqlalchemy has some mechanisms for this, and other libraries exist. 10

YOU DON T NEED A PLUGIN Often the functionality you need needn t be coupled to flask in any way. Instead of how do I do this in django?, you re asking, how do you do this in python? Model architecture and ORM s sqlalchemy is popular often simple python wrapper libraries are sufficient Test frameworks unittest, nose, mock, etc work well for us 11

BUT IF YOU DO NEED A PLUGIN There are also lots of Flask plugins available, and it s easy to write your own. Here are some of the pieces of functionality & plugins that we use: blueprints: similar to django apps Flask-Login: session management Flask-OAuth / Flask-OpenID Flask-Assets: merge & compress js/css Flask-Babel: translation & localization management 12

SUMMARY Django and Flask are both great pieces of software! Much of the preference hinges on whether Django s architecture resonates with you and is appropriate for your project.! Feel free to reach out! danob@jana.com craig@jana.com twitter: @janatechteam http://technology.jana.com/ 13