FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
template-python-django/.gitpod.yml at main · gitpod-samples/template-python-django · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
gitpod-samples
/
template-python-django
Public template
Notifications
You must be signed in to change notification settings
Fork
82
Star
21
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
template-python-django
/
.gitpod.yml
Copy path
More file actions
More file actions
Latest commit
History
History
History
48 lines (39 loc) · 1.45 KB
Breadcrumbs
template-python-django
/
.gitpod.yml
Copy path
File metadata and controls
48 lines (39 loc) · 1.45 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#
Image source code: https://github.com/axonasif/workspace-images/tree/tmp
#
Also see: https://github.com/gitpod-io/workspace-images/issues/1071
image
:
axonasif/workspace-python@sha256:f5ba627a31505ea6cf100abe8e552d7ff9e0abd6ba46745b6d6dab349c001430
tasks
:
-
name
:
Init project and run server
init
:
|
# Install Django and upgrade some dependencies
pip install --upgrade pip wheel setuptools
pip install Django
# Init Django project
name="mysite"
if test ! -e "${name}"; then {
django-admin startproject "${name}" .
} fi
# Modify settings.py to include Gitpod port hosts
settings="${name}/settings.py"
if test -e "${settings}" && ! grep -q 'GITPOD_WORKSPACE_URL' "${settings}" 2>/dev/null; then {
cat >> "${settings}" << 'SCRIPT'
if __import__('os').environ.get('GITPOD_WORKSPACE_URL'):
try:
gp = __import__('subprocess').run(["gp", "url", "8000"], capture_output=True, text=True)
if gp.returncode == 0 and gp.stdout:
ALLOWED_HOSTS += [gp.stdout.strip().split('//', 1)[-1]]
except:
ALLOWED_HOSTS += ['*']
SCRIPT
} fi
if test -e requirements.txt; then {
pip install -r requirements.txt
} fi
python manage.py migrate
command
:
|
python manage.py runserver
ports
:
-
port
:
8000
onOpen
:
open-preview
vscode
:
extensions
:
-
ms-python.python
Back
|
FazBrowse Home
|
New Git URL