Slide 1

Slide 1 text

Full-stack Python Web Applications

Slide 2

Slide 2 text

Kate Heddleston @heddle317

Slide 3

Slide 3 text

Python is often one part of a much larger system.

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

What we’re going to talk about... 1. A (semi) typical web application 2. Dev, staging, production, deploy system 3. Helpful python libraries

Slide 6

Slide 6 text

What we’re not going to talk about... ● Massively scalable web applications. ● Every single installation on the machine. ● Nitty gritty details of anything.

Slide 7

Slide 7 text

Web Application

Slide 8

Slide 8 text

Parts of a Stack 1. Operating System 2. Web Server 3. Database 4. Application Language

Slide 9

Slide 9 text

Web Server Apache mod_wsgi Application Code Python Application Code Python

Slide 10

Slide 10 text

Postgres Database Data

Slide 11

Slide 11 text

Web Server Apache mod_wsgi Application Code Python Postgres Database

Slide 12

Slide 12 text

Web Server Application Code Database

Slide 13

Slide 13 text

Web Server Nginx/ Gunicorn Apache/ mod_wsgi

Slide 14

Slide 14 text

Application Code Frameworks Python libraries Frontend Static Files (maybe)

Slide 15

Slide 15 text

Database PostgreSQL MySQL SQLServer Redis MongoDB

Slide 16

Slide 16 text

Web Server Application Code Database Logging

Slide 17

Slide 17 text

Logging Log files on the machine

Slide 18

Slide 18 text

Web Server Application Code Logging Version Control Database

Slide 19

Slide 19 text

Version Control git svn Github Bitbucket

Slide 20

Slide 20 text

Web Server Application Code Logging Version Control Database SMTP Server

Slide 21

Slide 21 text

SMTP Server PostmarkApp Sendgrid Amazon SES

Slide 22

Slide 22 text

Web Server Application Code Logging Version Control Database SMTP Server Data Store Async Tasks

Slide 23

Slide 23 text

Async Frameworks Twisted Tornado Async Tasks Python-rq/Redis Celery/RabbitMQ

Slide 24

Slide 24 text

Web Server Application Code Logging Version Control Database SMTP Server Data Store Async Tasks !Exception Handling!

Slide 25

Slide 25 text

!Exception Handling! Emails

Slide 26

Slide 26 text

Web Server Application Code Logging Version Control Database SMTP Server Data Store Async Tasks !Exception Handling!

Slide 27

Slide 27 text

Web Server Application Code Logging Version Control Database SMTP Server Data Store Async Tasks !Exception Handling!

Slide 28

Slide 28 text

Web Server Application Code Logging Version Control Database SMTP Server Data Store Async Tasks !Exception Handling! Cache

Slide 29

Slide 29 text

Cache Memcached Redis Varnish

Slide 30

Slide 30 text

Web Server Application Code Logging Database Data Store Async Tasks !Exception Handling! Cache Monitoring

Slide 31

Slide 31 text

Monitoring New Relic Nagios Pingdom

Slide 32

Slide 32 text

Web Server Application Code Logging Database Data Store Async Tasks !Exception Handling! Cache

Slide 33

Slide 33 text

Web Server Application Code Logging Database Data Store Async Tasks !Exception Handling! Cache

Slide 34

Slide 34 text

!Exception Handling! Emails Sentry

Slide 35

Slide 35 text

Web Server Application Code Logging Database Data Store Async Tasks !Exception Handling! Cache

Slide 36

Slide 36 text

Logging Log Server Loggly Splunk

Slide 37

Slide 37 text

Web Server Application Code Logging Database Data Store Async Tasks !Exception Handling! Cache

Slide 38

Slide 38 text

Web Server Application Code Database Data Store Async Tasks Cache Web Server Application Code Cache Load Balancer

Slide 39

Slide 39 text

Logging !Exception Handling! Monitoring Version Control SMTP Server

Slide 40

Slide 40 text

Web Server Application Code Database Data Store Async Tasks Cache Load Balancer Web Server Application Code Cache Data Store Async Tasks Database Database

Slide 41

Slide 41 text

System of Systems

Slide 42

Slide 42 text

Production (aka everything you just built) Dev Deploy

Slide 43

Slide 43 text

Dev Venv & Venvwrapper Vagrant & VirtualBox

Slide 44

Slide 44 text

Deploy git pull & restart services

Slide 45

Slide 45 text

Deploy Production (aka everything you just built) Dev Testing

Slide 46

Slide 46 text

Testing Jenkins CircleCI TravisCI

Slide 47

Slide 47 text

Deploy Production Dev Testing Staging Dev Dev

Slide 48

Slide 48 text

Server Config Chef Puppet Ansible SaltStack Docker

Slide 49

Slide 49 text

Deploy Chef Puppet Ansible SaltStack Docker

Slide 50

Slide 50 text

Dev Venv & Venvwrapper Vagrant & VirtualBox

Slide 51

Slide 51 text

Deploy Production Dev Testing Staging Dev Dev Deploy Production Dev Testing Staging Dev Dev

Slide 52

Slide 52 text

Hosting AWS Rackspace Linode

Slide 53

Slide 53 text

Chef Repo for a Web Application https://github.com/heddle317/django-chef-application

Slide 54

Slide 54 text

PaaS Heroku Elastic Beanstalk

Slide 55

Slide 55 text

Resources Maps https://github.com/heddle317/full-stack- resources/tree/master/resources_maps

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

Talk Maps https://github.com/heddle317/full-stack- resources/tree/master/talk_maps

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

3 Takeaways ● What are the basic pieces of a full-stack. ● What do these pieces look like in different environments. ● Resources for learning more and working with these pieces.

Slide 65

Slide 65 text

Ask your questions now. Kate Heddleston @heddle317 https://github.com/heddle317/full-stack-resources

Slide 66

Slide 66 text

“A complex system that works is invariably found to have evolved from a simple system that works.” — John Gall, Systemantics (1975)

Slide 67

Slide 67 text

“A system is never finished being developed until it ceases to be used.” — attributed to Gerald M. Weinberg

Slide 68

Slide 68 text

“It is as if perfection be attained not when there is nothing more to add, but when there is nothing more to take away.” — Antoine de Saint-Exupéry, Terre des Hommes (1939)

Slide 69

Slide 69 text

“There is no such thing as a small change to a large system.” — systems folklore, source lost in the mists of time

Slide 70

Slide 70 text

“Everything should be made as simple as possible, but no simpler.” — commonly attributed to Albert Einstein; it is actually a paraphrase of a comment he made in a 1933 lecture at Oxford