Top Banner
` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)
25

` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Heroku Python:Transitioning a Django Application

Richard Tibbetts (@tibbetts)SellerCrowd (@sellercrowd)

Page 2: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

SellerCrowd – Pseudonymous Q&A

• Social site for salespeople• Built using Python/Django/Tastypie/jQuery

Page 3: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

SellerCrowd Adoption

• Launched in September, Rapid Adoption

Week 1 Week 2 Week 3 Week 4

Page 4: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

SellerCrowd Adoption

• Machine resources becoming an issue

Page 5: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

System Administration Sucks

• I’m a terrible Sysadmin

• Even with Linode, Ubuntu, Chef

• I wish I had Heroku

Thou shalt not covet

thy neighbors scalable

deployment platform

Page 6: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

What is Heroku?

• Cloud application platform• Originally for Rails applications• Scalability• Lots of add-ons.

Page 7: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Heroku Cedar – Polyglot Platform

• Launched Python Sept 28

Page 8: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Sign Up

Page 9: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Check Your Stack

Heroku SellerCrowdDjangoPostgresGitPipVirtualenvSouth

Page 10: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Make a branch and fix things

• git branch heroku

Page 11: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Conditional Settings

• No setup.sh on deploy• Change default settings to be heroku settings

Page 12: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Virtualenv setup

• Must be in requirements.txt at the root of the git repository

Page 13: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Everything in a subdirectory

• All the django app code

mkdir sellercrowdgit mv scsite templates static \ sellercrowd

Page 14: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Create Heroku Remote

Page 15: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Test on Heroku

• Git push and then it’s all hooks

Page 16: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

syncdb, migrate, etc

• heroku run python sellercrowd/manage.py syncdb

• heroku run python sellercrowd/manage.py migrate

• heroku run python sellercrowd/manage.py loadavatars

Page 17: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Errors on the Website

Page 18: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Configuring static content

Page 19: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

heroku log

Page 20: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Success! (blazing-day-9336)

Page 21: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Configuring DNS

• Add customdomain addon• CNAME to sellercrowd.herokuapp.com

Page 22: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

heroku.sellercrowd.com

Page 23: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Scale and Add On

Page 24: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Heroku Transition Results

• Developer Time: About 5 hours• Remarkably smooth for a first gen platform• Git integration and heroku command line tools

are slick• Next steps:– Performance testing– Queues and workers– Add-ons: Search, logging, monitoring, realtime

Page 25: ` ` Heroku Python: Transitioning a Django Application Richard Tibbetts (@tibbetts) SellerCrowd (@sellercrowd)

`

Plugging SellerCrowd

• Clay Gran, Richard Tibbetts, Ustun Ozgur• Looking for one more team member• Talk to us after