Ejemplo n.º 1
0
    def _create_template_git_project(self, name):
        ignorance = gitignore.src()

        with open(".gitignore", "w") as f:
            f.write(ignorance)

        command("git init")
Ejemplo n.º 2
0
 def _create_app(self, name):
     command("python manage.py startapp " + name)
Ejemplo n.º 3
0
 def _puash(self):
     command("git push -u origin master")
Ejemplo n.º 4
0
 def _pull(self):
     command("git pull origin master")
Ejemplo n.º 5
0
    def main(self):
        # Check

        try:
            self._check_before()
        except:
            return

        # Input information
        log("Please type your new Django application information.")

        # Check namespace
        try:
            self._project_name = log("Project name", withInput=True)
            self._check_namesapce(self._project_name)
        except:
            log("Project \"{0}\" is already exists.".format(
                self._project_name),
                withError=True,
                errorDetail=
                "Please remove duplication of Django project namespace.")
            return

        version = log("App version", withInput=True, default="0.0.1")
        author = log("Author name", withInput=True)
        email = log("Email", withInput=True)
        git_url = log("Git URL", withInput=True)
        license_name = log("License", withInput=True)
        description = log("Description", withInput=True)
        copyrightor = log("Copyrightor", withInput=True, default=author)

        self._create_new_django_app()

        with proj.InDir("./" + self._project_name):

            # Generate .gitignore
            log("Generating gitignore...")
            self._create_template_git_project()

            # Generate README.md
            log("Generating readme...")
            self._create_docs()

            # Generate Miragefile
            log("Generating Miragefile...")
            self._create_miragefile(version, author, email, git_url,
                                    license_name, description, copyrightor)

            # Add remote repo
            log("Adding remote repository...")
            command("git remote add origin " + git_url)

            # Make shell directory
            os.mkdir("shell")

        with proj.InDir("./shell"):

            # Generate package.json
            log("Generating package configuration...")
            self._create_package_json(version, description, git_url, author,
                                      email, license_name)

            # Install webpack
            log("Installing assets builder...")
            command("yarn add --dev webpack")

        # Completed
        log("Completed!")
Ejemplo n.º 6
0
 def _create_new_django_app(self, name):
     log("Creating Django CMS application...")
     log("Please wait for a moment.")
     command("djangocms " + name)
Ejemplo n.º 7
0
 def _create_new_django_app(self):
     command("django-admin startproject " + self._project_name)