Heroku Python: First Look

advertisement
`
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
`
SellerCrowd Adoption
• Launched in September, Rapid Adoption
Week 1
Week 2
Week 3
Week 4
`
SellerCrowd Adoption
• Machine resources becoming an issue
`
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
`
What is Heroku?
•
•
•
•
Cloud application platform
Originally for Rails applications
Scalability
Lots of add-ons.
`
Heroku Cedar – Polyglot Platform
• Launched Python Sept 28
`
Sign Up
`
Check Your Stack
Heroku
SellerCrowd
Django
Postgres
Git
Pip
Virtualenv
South
`
Make a branch and fix things
• git branch heroku
`
Conditional Settings
• No setup.sh on deploy
• Change default settings to be heroku settings
`
Virtualenv setup
• Must be in requirements.txt at the root of the
git repository
`
Everything in a subdirectory
• All the django app code
mkdir sellercrowd
git mv scsite templates static \
sellercrowd
`
Create Heroku Remote
`
Test on Heroku
• Git push and then it’s all hooks
`
syncdb, migrate, etc
• heroku run python
sellercrowd/manage.py syncdb
• heroku run python
sellercrowd/manage.py migrate
• heroku run python
sellercrowd/manage.py loadavatars
`
Errors on the Website
`
Configuring static content
`
heroku log
`
Success! (blazing-day-9336)
`
Configuring DNS
• Add customdomain addon
• CNAME to sellercrowd.herokuapp.com
`
heroku.sellercrowd.com
`
Scale and Add On
`
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
`
Plugging SellerCrowd
• Clay Gran, Richard Tibbetts, Ustun Ozgur
• Looking for one more team member
• Talk to us after
`
Download