def runserver(): """Runs the Django development server""" print green("Running the development webserver...") denv = fabutils.dot_env() host = denv.get('SERVER_HOST', '0.0.0.0') port = denv.get('PORT', '8000') fabutils.manage_py('runserver %s:%s' % (host, port))
def make_test_data(outfile=default_test_data_path): """Updates the test_data.json file based on what is in the database""" print green("Saving test data from %s to %s" % (test_data_apps, outfile)) args = ' '.join(test_data_apps + ('--exclude=auth.Permission',)) if fabutils.manage_py("dumpdata --indent=2 %s > %s" % (args, outfile)): print "Make test data successful."
def load_test_data(infile=default_test_data_path): """Load test data from test_data.json""" if infile.exists(): print green("Loading test data from %s" % infile) if fabutils.manage_py("loaddata %s" % infile): print "Load test data successful." else: print yellow("No test data found")
def make_test_data(outfile=default_test_data_path): """Updates the test_data.json file based on what is in the database""" print green("Saving test data from %s to %s" % (test_data_apps, outfile)) args = ' '.join(test_data_apps + ('--exclude=auth.Permission', )) if fabutils.manage_py("dumpdata --indent=2 %s > %s" % (args, outfile)): print "Make test data successful."
def reset_db(): """Removes all of the tables""" fabutils.manage_py("reset_db")
def build_static(): """Builds static files for production""" print green("Gathering and preprocessing static files...") fabutils.manage_py('collectstatic --noinput -i media') fabutils.manage_py('compress')
def migrate(): """Runs migrations""" print green("Running migrations...") if fabutils.manage_py('migrate'): print "Migrations successful."
def manage(command): """Run a Django management command.""" fabutils.manage_py(command)
def build_static(): """Builds static files for production""" print green("Gathering and preprocessing static files...") fabutils.manage_py('collectstatic --noinput') fabutils.manage_py('compress')