Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Django sample #13135

Merged
merged 1 commit into from
Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions ide/che-core-ide-stacks/src/main/resources/stacks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2576,32 +2576,38 @@
"description": "Default stack with Python 3.7 and Theia IDE",
"components": [
{
"version": "9",
"name": "Debian"
"version": "7.6",
"name": "CentOS"
},
{
"version": "3.7.3",
"version": "3.6.3",
"name": "Python"
},
{
"version": "19.0.3 ",
"version": "9.0.1",
"name": "PIP"
}
],
"workspaceConfig": {
"environments": {
"default": {
"recipe": {
"content": "python:3.7.3",
"content": "centos/python-36-centos7:1",
"type": "dockerimage"
},
"machines": {
"python": {
"servers": {
"django": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need a server? Isn't the port plugin exposing it automatically?

Copy link
Contributor Author

@tolusha tolusha Apr 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the port plugin exposing it automatically?

Yes, it is. But after a little application becomes unavailable.
So, that's why I added sever to the list

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you saying that the application is unstable when using the port plugin but works just fine if you define a server?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly

Logs from theia-ide container (minishift):

root ERROR Uncaught Exception:  Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
--
  | root ERROR Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
  | at ChildProcess.target.send (internal/child_process.js:636:16)
  | at HostedPluginProcess.onMessage (/home/theia/node_modules/@theia/plugin-ext/lib/hosted/node/hosted-plugin-process.js:105:31)
  | at ServerPluginProxyRunner.onMessage (/home/theia/node_modules/@eclipse-che/theia-remote/lib/node/server-plugin-proxy-runner.js:49:32)
  | at /home/theia/node_modules/@theia/plugin-ext/lib/hosted/node/hosted-plugin.js:99:28
  | at Array.forEach (<anonymous>)
  | at HostedPluginSupport.onMessage (/home/theia/node_modules/@theia/plugin-ext/lib/hosted/node/hosted-plugin.js:97:32)
  | at HostedPluginServerImpl.onMessage (/home/theia/node_modules/@theia/plugin-ext/lib/hosted/node/plugin-service.js:152:27)
  | at JsonRpcProxyFactory.onNotification (/home/theia/node_modules/@theia/core/lib/common/messaging/proxy-factory.js:246:36)
  | at /home/theia/node_modules/@theia/core/lib/common/messaging/proxy-factory.js:181:53
  | at handleNotification (/home/theia/node_modules/vscode-jsonrpc/lib/main.js:483:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"attributes": {},
"protocol": "http",
"port": "7000"
}
},
"env": {
"PS1": "$(echo ${0})\\$ ",
"HOME": "/home/user"
},
"servers": {},
"volumes": {
"projects": {
"path": "/projects"
Expand Down
60 changes: 60 additions & 0 deletions ide/che-core-ide-templates/src/main/resources/samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -1219,5 +1219,65 @@
"tags": [
"Python"
]
},
{
"name": "django-realworld-example-app",
"displayName": "django-realworld-example-app",
"path": "/django-realworld-example-app",
"description": "Django Real World Example.",
"projectType": "python",
"mixins": [],
"attributes": {
"language": [
"python"
]
},
"modules": [],
"problems": [],
"source": {
"type": "git",
"location": "https://github.com/gothinkster/django-realworld-example-app",
"parameters": {}
},
"commands": [
{
"name": "install requirements",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/django-realworld-example-app && pip install -r requirements.txt",
"attributes": {
"goal": "Run"
}
},
{
"name": "migrate",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/django-realworld-example-app && python manage.py migrate",
"attributes": {
"goal": "Run"
}
},
{
"name": "patch resources",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/django-realworld-example-app && sed -i \"s/ALLOWED_HOSTS = \\[\\]/ALLOWED_HOSTS = \\['*'\\]/g\" conduit/settings.py",
"attributes": {
"goal": "Run"
}
},
{
"name": "run server",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/django-realworld-example-app && python manage.py runserver 0.0.0.0:7000",
"attributes": {
"previewUrl": "${server.django}/admin",
"goal": "Run"
}
}
],
"links": [],
"category": "Samples",
"tags": [
"Python", "Django"
]
}
]