#!/usr/bin/env python
import os
import subprocess
import sys

# HACK: Install dependencies if not already installed
PIP_LOG = 'pip.install.log'
if not os.path.exists(PIP_LOG):
    with open(PIP_LOG, 'wb') as LOG_FILE:
        print 'Installing dependencies...'
        subprocess.check_call(
            ['pip', 'install', '-r', '../requirements.txt'],
            stdout=LOG_FILE,
            stderr=LOG_FILE
        )
        print 'Dependencies installed...'

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "braintree_api.settings")

    from django.core.management import execute_from_command_line

    execute_from_command_line(sys.argv)

@@ -55,16 +55,48 @@
 rt sys%0A%0A
+if __name__ == %22__main__%22:%0A%0A    
 # HACK: 
@@ -141,16 +141,20 @@
 stalled%0A
+    
 PIP_LOG 
@@ -173,16 +173,20 @@
 ll.log'%0A
+    
 if not o
@@ -213,16 +213,20 @@
 G):%0A    
+ 
+   
 with ope
@@ -259,24 +259,28 @@
 LE:%0A        
+  
+  
 print 'Insta
@@ -302,16 +302,20 @@
 ies...'%0A
+    
         
@@ -349,16 +349,20 @@
         
+    
 %5B'pip', 
@@ -414,16 +414,20 @@
         
+  
+  
 stdout=L
@@ -435,16 +435,20 @@
 G_FILE,%0A
+    
         
@@ -475,16 +475,20 @@
         
+    
 )%0A      
@@ -485,24 +485,28 @@
   )%0A        
+ 
+   
 print 'Depen
@@ -531,36 +531,73 @@
 ..'%0A
-%0Aif __name__ == %22__main__%22:%0A
+            subprocess.call(%5B'python'%5D + sys.argv)%0A    else:%0A    
     
@@ -618,16 +618,29 @@
 default(
+%0A            
 %22DJANGO_
@@ -685,11 +685,24 @@
 ngs%22
-)%0A%0A
+%0A        )%0A%0A    
     
@@ -763,16 +763,20 @@
 d_line%0A%0A
+    
     exec

Fix auto-installation