Pluggable Patterns. For Reusable Django Applications

Similar documents
KNIME Extension Points. Tobias Kötter University of Konstanz

Djam Documentation. Release Participatory Culture Foundation

Bambu API Documentation

This hot fix provides four registry keys to hide redundant notification/log created for cached messages.

django-baton Documentation

django-app-metrics Documentation

django-image-cropping Documentation

Administrator Manual. Last Updated: 15 March 2012 Manual Version:

wagtail-robots Documentation

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

django-baton Documentation

django-fluent-dashboard Documentation

Administrator Manual. Last Updated: 15 March 2012 Manual Version:

Django. Jinja2. Aymeric Augustin DjangoCong 2016

django-gollum Documentation

Oracle APEX 18.1 New Features

Django Synctool Documentation

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

Who should use this manual. Signing into WordPress

colab Documentation Release 2.0dev Sergio Oliveira

django-scaffold Documentation

CSCI 1320 Creating Modern Web Applications. Content Management Systems

django-oauth2-provider Documentation

PHP WITH ANGULAR CURRICULUM. What you will Be Able to Achieve During This Course

django-telegram-bot Documentation

django-intercom Documentation

Materials Data Curation System

alphafilter Documentation

wagtailmenus Documentation

A Guide to CMS Functions

django-push Documentation

Manual Html Image Src Url Path Not Working

Django Test Utils Documentation

django-sticky-uploads Documentation

Django Leaflet Documentation

Gargoyle Documentation

Getting started with Convertigo Mobilizer

The Django Web Framework Part II. Hamid Zarrabi-Zadeh Web Programming Fall 2013

django-messages Documentation

ANGULAR 2.X,4.X + TYPESRCIPT by Sindhu

kaleo Documentation Release 1.5 Eldarion

Easy Authcache documentation

wagtailmenus Documentation

Drupal 8 THE VIDER ITY APPR OACH

wagtailtrans Documentation

Django: Views, Templates, and Sessions

cmsplugin-blog Release post 0 Øyvind Saltvik

Webform: THERE IS THIS FOR THAT

Django-Select2 Documentation. Nirupam Biswas

User s Guide to MiParque.org

Blog Pro for Magento 2 User Guide

django-precise-bbcode Documentation

spaste Documentation Release 1.0 Ben Webster

micawber Documentation

WSRP Web Services for Remote Portlets

Investigating Source Code Reusability for Android and Blackberry Applications

Lotus IT Hub. Module-1: Python Foundation (Mandatory)

Django-CSP Documentation

Webform: THERE IS THIS FOR THAT

VMware AirWatch Chrome OS Platform Guide Managing Chrome OS Devices with AirWatch

ApacheCon NA How to Avoid Common Mistakes in OFBiz Development Presented by Adrian Crum

Object oriented programming. Encapsulation. Polymorphism. Inheritance OOP

nacelle Documentation

django-cms-search Documentation

django-model-report Documentation

AngularJS Fundamentals

django_podcasting Documentation

Writing a Django e- commerce framework OSCON 2012

Ace Corporate Documentation

VB.NET. Exercise 1: Creating Your First Application in Visual Basic.NET

CIS192 Python Programming

Django Phantom Theme Documentation

XML. Jonathan Geisler. April 18, 2008

django-ratelimit-backend Documentation

Documentation for the new Self Admin

Feature: Online App Builder Studio

Getting Started with Autodesk Vault Programming

Oracle WebCenter Interaction: Roadmap for BEA AquaLogic User Interaction. Ajay Gandhi Sr. Director of Product Management Enterprise 2.

Zope Product Development With CMF/Plone. Reid Linnemann Oklahoma Department of Career and Technology Education

A User Guide. Besides, this Getting Started guide, you ll find the Zoho Campaigns User Guide and many other additional resources at zoho.com.

Full Stack Web Developer

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

Bricks Documentation. Release 1.0. Germano Guerrini

In This Guide. Quick Start Guide REAL 737 edspace.american.edu

django-sendgrid-events Documentation

Microsoft Visual C# Step by Step. John Sharp

Configuring and Customizing the ArcGIS Viewer for Silverlight. Katy Dalton

Hands-On Perl Scripting and CGI Programming

Remote Entities: Past, Present & Future

Here's how we are going to Supercharge WordPress.

Widget Toolkits CS MVC

M Introduction to Visual Basic.NET Programming with Microsoft.NET 5 Day Course

of websites on the internet are WordPress

WORDPRESS 101 A PRIMER JOHN WIEGAND

How To Set Up The Genius Store Builder Theme Step--By--Step Guide For Building Your First Profitable Affiliate Store

Course Title: Python + Django for Web Application

MARS AREA SCHOOL DISTRICT Curriculum TECHNOLOGY EDUCATION

Etanova Enterprise Solutions

Microsoft. Developing Microsoft SharePoint Server 2013 Advanced Solutions

Contents. Managing Places...3. Contents 2

Transcription:

Pluggable Patterns For Reusable Django Applications

Project

Project Configuration URL routing Templates

Project Application Application Application Application Application Application Application Application Application Configuration URL routing Templates

Here there be power! Project Application Application Application Application Application Application Application Application Application Configuration URL routing Templates

We need a better definition for Django Application

An app should not be a monolithic pile of code For example, most blog apps available provide too much functionality MyBlog App Categories Custom Tagging Custom Comments Comment Moderation Assumption of text markup type Single blogs Multiple Sites ACME MONOLITHS

An application should be pluggable

A pluggable app is Focused Write programs that do one thing and do it well. Doug McIlroy (inventor of UNIX pipes)

A pluggable app is Self-Contained Batteries are included Dependencies are declared

A pluggable app is Easily Adaptable Corey s Law: The less adaptable you make your code, the sooner you will be tasked to adapt it.

A pluggable app is Easily Installed pip install coolapp You did declare your dependencies, right?

How do we make a pluggable application?

Stop thinking like this http://upload.wikimedia.org/wikipedia/commons/archive/a/aa/20090315161532!ferrari_enzo_ferrari.jpg

and think like this http://www.flickr.com/photos/motagirl2/4301276868/

Applications can have very different purposes http://www.photoshoproadmap.com/imagenes/blog/lego-brushes/lego-bricks-high-resolution.jpg

Application Types Data. Manages specific data and access to it Utility. Provide a way of handling a specific problem for any application Decorator. Adds functionality to one or aggregates functionality of many applications

Data Apps http://www.geeky-gadgets.com/wp-content/uploads/2009/08/lego-usb-hub_2.jpg

Situation 1 Lots of variations Each implementation is different (e.g. blogs)

Abstract Models GLAMKit http://www.glamkit.org/ EntryBase FeaturableEntryMixin StatusableEntryMixin TaggableEntryMixin HTMLFormattableEntryMixin

Situation 2 A few, well-known of variations (e.g. Use django.contrib.sites?)

Optional Field Settings

Situation 3 Optionally use another application (e.g. Use django-tagging?)

Optional Integration

Optional Integration

Situation 3 You want to reference different models (e.g. Customizable author field)

Configurable Foreign Keys Viewpoint http://github.com/washingtontimes

Situation 3 You want to provide hooks for other applications (e.g. While processing in a view)

Emit Signals Satchmo http://www.satchmoproject.com/

Utility Apps http://www.1000steine.com/brickset/images/852759-1.jpg

Utility apps are just code libraries

Projects with template tags need one

Does it need to be in? Yes, if you have: Templates Template Tags Management Commands

Decorator Apps http://trendland.net/wp-content/uploads/2008/12/lego-ring.jpg

CoolApp New Method Custom Manager New Field New Admin

Registering for Decoration

Simple Model Registry

Model-Data Registry

Lazy Registration

Situation 4 You want to add a field to a model (e.g. Link to another model)

Simple Model Registry

Situation 5 You want to add a method to a model (e.g. Link to another model)

Adding methods

Situation 6 You want to customize a model s ModelAdmin (e.g. Change the widget of a field)

Lazy Registration of a Custom ModelAdmin

Lazy Registration of a Custom ModelAdmin

Lazy Registration of a Custom ModelAdmin

Touch Points

Touch Points of an App The parts of an application that usually need tweaking URLs Templates Configurable options View responses

Situation 7 You want the URLs of your app to live under any prefix (e.g. /blogs/ vs. /weblogs/)

Name your URLs

Reference your URLs by name

Situation 8 You want your templates to be easily overridable

Namespace Templates coolapp templates coolapp base.html

Namespace Templates coolapp templates All templates in a template name space coolapp base.html

Namespace Templates coolapp templates coolapp All templates extend a single template base.html

Namespace Templates coolapp templates coolapp This template simply base.html

Import your blocks Allows you to override any of the templates extra_head.html content.html base.html

Situation 9 You want to configure your app without modifying its code (e.g. API keys)

Configurable Options Django Supertagging http://github.com/josesoa Internal Name Setting Name Default Value

Configurable Options Django Debug Toolbar http://github.com/robhudson

Define a Storage Option

Situation 10 You want to alter the data your views use (e.g. Extra context, different template)

Add keyword arguments Django Registration http://bitbucket.org/ubernostrum

Class-based Views http://github.com/bfirsh/django-class-based-views http://github.com/pegasus/django-baseviews http://code.djangoproject.com/ticket/6735 http://codysoyland.com/2010/feb/3/thread-safe-objectoriented-views-django/ http://www.toddreed.name/content/django-view-class/

To be continued

My Info coreyoordt@gmail.com @coordt github.com/coordt github.com/washingtontimes opensource.washingtontimes.com