diff --git a/devfiles/python-django/devfile.yaml b/devfiles/python-django/devfile.yaml new file mode 100644 index 000000000..4235a0b95 --- /dev/null +++ b/devfiles/python-django/devfile.yaml @@ -0,0 +1,60 @@ +--- +apiVersion: 1.0.0 +metadata: + name: python-django +projects: + - + name: django-realworld-example-app + source: + type: git + location: "https://github.com/gothinkster/django-realworld-example-app" +components: + - + type: chePlugin + id: ms-python/python/latest + memoryLimit: 512Mi + - + type: dockerimage + alias: python + image: centos/python-36-centos7:1 + command: ['sleep'] + args: ['infinity'] + env: + - name: HOME + value: /home/user + - name: PS1 + value: $(echo ${0})\\$ + memoryLimit: 512Mi + endpoints: + - name: 'django' + port: 7000 + mountSources: true +commands: + - + name: install requirements + actions: + - + type: exec + component: python + command: cd ${CHE_PROJECTS_ROOT}/django-realworld-example-app && pip install -r requirements.txt + - + name: migrate + actions: + - + type: exec + component: python + command: cd ${CHE_PROJECTS_ROOT}/django-realworld-example-app && python manage.py migrate + - + name: patch resources + actions: + - + type: exec + component: python + command: cd ${CHE_PROJECTS_ROOT}/django-realworld-example-app && sed -i "s/ALLOWED_HOSTS = \[\]/ALLOWED_HOSTS = \['*'\]/g" conduit/settings.py + - + name: run server + actions: + - + type: exec + component: python + command: cd ${CHE_PROJECTS_ROOT}/django-realworld-example-app && python manage.py runserver 0.0.0.0:7000 diff --git a/devfiles/python-django/meta.yaml b/devfiles/python-django/meta.yaml new file mode 100644 index 000000000..9d7d9f4e0 --- /dev/null +++ b/devfiles/python-django/meta.yaml @@ -0,0 +1,6 @@ +--- +displayName: Python with Theia IDE +description: Default stack with Python 3.7 and Theia IDE adapted to work with Django +tags: ["Theia", "Debian", "Python", "pip"] +icon: https://www.eclipse.org/che/images/logo-eclipseche.svg +globalMemoryLimit: 1686Mi diff --git a/devfiles/python/devfile.yaml b/devfiles/python/devfile.yaml index 3628948c2..13968b766 100644 --- a/devfiles/python/devfile.yaml +++ b/devfiles/python/devfile.yaml @@ -2,6 +2,12 @@ apiVersion: 1.0.0 metadata: name: python +projects: + - + name: python-hello-world + source: + type: git + location: "https://github.com/che-samples/python-hello-world.git" components: - type: chePlugin @@ -19,7 +25,12 @@ components: - name: PS1 value: $(echo ${0})\\$ memoryLimit: 512Mi - endpoints: - - name: 'django' - port: 7000 mountSources: true +commands: + - + name: run + actions: + - + type: exec + command: "cd ${CHE_PROJECTS_ROOT}/python-hello-world && python hello-world.py" + component: python