Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
Update Python and Django samples
Browse files Browse the repository at this point in the history
Signed-off-by: Sergii Leshchenko <[email protected]>
  • Loading branch information
sleshchenko authored and monaka committed Jun 19, 2019
1 parent 1a405d2 commit 22f1b7c
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 3 deletions.
60 changes: 60 additions & 0 deletions devfiles/python-django/devfile.yaml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions devfiles/python-django/meta.yaml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 14 additions & 3 deletions devfiles/python/devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 22f1b7c

Please sign in to comment.