Anonymous committed 5021152

check_call => fab_api changest

Comments (0)

Files changed (1)


     ## Create the base project structure using the built-in commands from
     # Django after changing directories accordingly
     print "...start project using"
-    check_call(['','startproject','--template',args.template,'-e','conf',args.site_name])
+    check_call(['', 'startproject', '--template',args.template, '-econf,sh', args.site_name])
     ## Install required modules
     REQ_TXT = os.path.join(DIR_PROJECT, "requirements.txt")
     ## Create the site's database, dropping any existing if needed
     print "...clear and rebuild a fresh database for %s" % args.site_name
     from _mysql import connect as mysql_connect
-    mysql_loc_pwd = raw_input("Password for your MySQL root account? ")
+    fab_api.prompt('What is the server MySQL root password:', 'mysqlpwd')
     mysql_rmt_pwd = raw_input("Password for your website sql user? ")
     ###TODO: should probably check if we really want to drop the existing database first
-    db=mysql_connect(user="root",passwd=mysql_loc_pwd)
+    db=mysql_connect(user="root",passwd='%s' % fab_api.env.mysqlpwd)
     db.query("DROP DATABASE IF EXISTS django_%s;" % args.site_name)
     db.query("CREATE DATABASE django_%s;" % args.site_name)
     db.query("GRANT ALL ON django_%s.* TO \'djangouser\'@\'localhost\' IDENTIFIED BY \'%s\';" % (args.site_name, mysql_rmt_pwd))
     DIR_DATACONF_NEW = os.path.join('/home', getuser(), '.soupmix', args.site_name)
     if not os.path.exists(DIR_DATACONF_NEW):
         print DIR_DATACONF_NEW
-        check_call(['mkdir', '-p', DIR_DATACONF_NEW])
-        check_call(['mv', '%s/grape_data' % DIR_BIN_OLD, DIR_DATACONF_NEW])
+'python migrate --verbosity=0')
+'mkdir -p %s' %s DIR_DATACONF_NEW)
+'mv %s/grape_data %s' % (DIR_BIN_OLD, DIR_DATACONF_NEW))
         check_call(['mv', '%s/nymph_data' % DIR_BIN_OLD, DIR_DATACONF_NEW])
     localhost_datafile = os.path.join(DIR_DATACONF_NEW, '%s_data' % gethostname())
     fab_api.env.host_string = 'localhost'
             # Update the database and link all media files
   'python syncdb --noinput --verbosity=0')
-            fab_api.local('python migrate --verbosity=0')
+  'python migrate --verbosity=0')
         DIR_BIN_NEW = os.path.join(DIR_PROJECT, 'bin')
         print DIR_BIN_NEW