Ejemplo n.º 1
0
    def migrate(self, mig):
        if mig:
            pull.print("*",
                       "Migration Phase. Initializing File & Configurations.",
                       pull.YELLOW)

            config = CONFIG()
            config.read_variables()
            config.generate_key()
            config.write()

            time.sleep(3)
            application = GETWSGI()

            pull.print("^", "Configuration Done. Uprnning Migrations Now. ",
                       pull.DARKCYAN)
            DJANGOCALL('makemigrations',
                       stdout=(sys.stdout if self.debug else self.npointer))
            pull.verbose("*", "Files Modified. Running Into Final Stage. ",
                         self.verbose, pull.YELLOW)
            DJANGOCALL('migrate',
                       stdout=(sys.stdout if self.debug else self.npointer))
            pull.halt("Migrations Applied Successfuly. Exiting Now!", True,
                      pull.GREEN)

            return True
        return False