Unable to get Django up and running
未关闭
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
调研方向
先查看 Landofile、requirements.txt 和 /app/airlineclub/manage.py,然后重现所示的 appserver 启动过程,并检查 build 步骤是否在命令之前运行。当配置的服务能够 import Django 并启动 manage.py runserver,且不再出现报告的 ModuleNotFoundError 时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Needs Triage
---
name: django-play
services:
appserver:
type: python:3.11
build:
- pip install --upgrade pip
- pip install -r requirements.txt
scanner: true
# NOTE: this entire Landofile hard codes a path to a project we assume exists. If you have a different
# name for your project, you'll have to change all occurences of 'firstapp' to whatever your project is named.
command: python /app/airlineclub/manage.py runserver 0:8800
overrides:
ports:
- "8000:8000"
environment:
# NOTE: change this path to match your project name
PYTHONPATH: "/app/airlineclub"
DJANGO_SETTINGS_MODULE: "firstapp.settings"
moreHttpPorts:
- "8000"
db:
# NOTE: the credentials below are the default for Lando, don't bother trying to change them
type: postgres:15
portforward: true
creds:
user: postgres
password:
database: django-play
tooling:
django-admin:
service: appserver
cmd: django-admin
python:
service: appserver
cmd: python
pip:
service: appserver
cmd: pip
manage:
service: appserver
# NOTE: change this path to match your project name
cmd: cd /app/airlineclub && python /app/airlineclub/manage.py
psql:
service: db
cmd: psql -U postgres
"db-import <file>":
service: :host
description: Imports a dump file into a database service
cmd: /helpers/sql-import.sh
options:
host:
description: The database service to use
default: db
alias:
- h
no-wipe:
description: Do not destroy the existing database before an import
boolean: true
results in:
appserver_1 | 2023-10-14T08:28:05.489931858Z lando 08:28:05.48 INFO ==> Lando handing off to: /bin/sh -c python /app/airlineclub/manage.py runserver 0:8800
appserver_1 | 2023-10-14T08:28:05.508377347Z Traceback (most recent call last):
appserver_1 | 2023-10-14T08:28:05.508414138Z File "/app/airlineclub/manage.py", line 10, in main
appserver_1 | 2023-10-14T08:28:05.508421998Z from django.core.management import execute_from_command_line
appserver_1 | 2023-10-14T08:28:05.508428058Z ModuleNotFoundError: No module named 'django'
appserver_1 | 2023-10-14T08:28:05.508433998Z
appserver_1 | 2023-10-14T08:28:05.508440028Z The above exception was the direct cause of the following exception:
appserver_1 | 2023-10-14T08:28:05.508445958Z
appserver_1 | 2023-10-14T08:28:05.508451679Z Traceback (most recent call last):
appserver_1 | 2023-10-14T08:28:05.508461699Z File "/app/airlineclub/manage.py", line 21, in <module>
appserver_1 | 2023-10-14T08:28:05.508468019Z main()
appserver_1 | 2023-10-14T08:28:05.508473529Z File "/app/airlineclub/manage.py", line 12, in main
appserver_1 | 2023-10-14T08:28:05.508495950Z raise ImportError(
appserver_1 | 2023-10-14T08:28:05.508502380Z ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
It appears that the build command isn't running before the command. What am I missing?
- 主要语言
- JavaScript
- 星标
- 3
- 派生
- 1
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
lando/python 的其他 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
难度 1/5 1 小时以内 新手友好度 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
难度 2/5 1-3 小时 新手友好度 84/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
难度 2/5 1-3 小时 新手友好度 72/100
bevyengine/bevy-website#2595 ·