Deploying Django AppsDiscovering Your ApproachDerek Stegelman 2013Boulder Django
Our To-dosWho am I?The problemSolutionsStory Telling Time/Deploying is more than aserverDiscussion
Who am ISoftware Developer at Five QPreviously at Kansas State UniversityDeveloped and maintained several >10,000 user applications (allPython/Django)New to the Front Rangehttps://github.com/dstegelmanSelf taught; Business/MIS Background
Django Hosting ???I wrote this app...now what?
The ProblemHosting a Django app is hard!Significant learning curve for new developersfrom the PHP, other web worldsToo many options (uWSGI, mod_wsgi,Gunicorn)No clear path on where to begin.Significant deterrent to growing thePython/Django community.
Solution(s)Roll your own (AWS, Rackspace, Datacenter)Story TimeMiddle Managed (Webfaction, etc)Managed (Heroku, Gondor, etc)Ultimately use what’s best for you and yoursituation. (Time, Money, Headaches..)
Roll Your OwnNot that difficultLarge learning curve, but maximum controlBest suited for Enterprise or large scalebusiness environmentsOften requires a SysAdmin to work properlyCheap and getting cheaper
A Deployment StoryMore than just hardwareWith a happy ending..
Where we startedSingle web/database serverMercurial copy and update to deploy or, ummFTP??? FTW?!Sys Admins had to manually “kick” apacheNo migrations or collect staticVery unstable deployments.Not all that uncommon
Oh, the server broke. Let me debug that.Inefficient use of developer’s time.Difficult, painful, and scary deploymentsDatabase changes were even more painfulDjango deployment was immatureHow to Fix?? Bring in an Expert.
Solution(s)Evaluated Managed options (Heroku,Webfaction etc)Too Expensive for our scale (and budget)Did not have expertise to build the systemourselvesHired an expert on Django
Where we wentFully automated environment with ChefFabric controlled, repeatable deploymentsCentralized infrastructure control (Chef/OpsCode)Inherited Fabric files and configurations(Repeatability across projects)Bundle infrastructure into your applications(Version Control All the Things)Version control ALL THE THINGS
Optimize HappinessNew stack optimized for developer happinessScratch your own itchAll but eliminated deployment headachesInstituted a semi formal standards systemthrough trial and errorHappy ending
Middle ManagedExample: WebfactionEntire box is managed, but you are left largelyto your own devices for detailsGood solution for DIYsA good middle ground.
Fully ManagedHeroku/GondorTheir way or the highwayGreat for prototyping/feature branchesLimited customizationEasiest to start withFriend for new developers!!Start Ups!
What should you do?Evaluate your needs and how manyheadaches you can standEvaluate your staffing needs/expertise andplanned scaleRoll Your Own takes a significant amount ofexpertise. Don’t underestimate it.
ToolsMany tools exist to make deployment andautomated tasks easier.FabricCapistrano/FabistranoChef/SaltJust use something!
FabricPlease, please use fabric. (Or another similartool)Codified, version controlled deploymentmechanisms that can be distributed FTW!When you make a change to your workflow,codify it.AUTOMATE!
Lessons to Live ByAUTOMATE EVERYTHINGVersion Control and codify your processesDon’t live with broken windowsDeployment is really important, invest in it!Choose the provider and solution that fits yourteam and specific needs