示例#1
0
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))
示例#2
0
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))
示例#3
0
    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."
示例#4
0
 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")
示例#5
0
 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")
示例#6
0
    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."
示例#7
0
def reset_db():
    """Removes all of the tables"""
    fabutils.manage_py("reset_db")
示例#8
0
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')
示例#9
0
def migrate():
    """Runs migrations"""

    print green("Running migrations...")
    if fabutils.manage_py('migrate'):
        print "Migrations successful."
示例#10
0
def manage(command):
    """Run a Django management command."""
    fabutils.manage_py(command)
示例#11
0
def reset_db():
    """Removes all of the tables"""
    fabutils.manage_py("reset_db")
示例#12
0
def build_static():
    """Builds static files for production"""

    print green("Gathering and preprocessing static files...")
    fabutils.manage_py('collectstatic --noinput')
    fabutils.manage_py('compress')
示例#13
0
def migrate():
    """Runs migrations"""

    print green("Running migrations...")
    if fabutils.manage_py('migrate'):
        print "Migrations successful."
示例#14
0
def manage(command):
    """Run a Django management command."""
    fabutils.manage_py(command)