python - Django Lightsail 上没有应用程序文件夹

标签 python django amazon-web-services bitnami amazon-lightsail

在 AWS 上创建新的 Lightsail django 实例后,我发现文件夹/opt/bitnami/apps/不存在,如文档 https://aws.amazon.com/getting-started/hands-on/deploy-python-application/ 中引用的那样。 。我之前在 AWS 上创建过 django 实例,但从未遇到过此问题。

bitnami@ip-172-26-4-185:~$ ls
bitnami_application_password  bitnami_credentials  htdocs  stack
bitnami@ip-172-26-4-185:~$ cd /
bitnami@ip-172-26-4-185:/$ cd opt
bitnami@ip-172-26-4-185:/opt$ cd bitnami
bitnami@ip-172-26-4-185:/opt/bitnami$ cd apps
-bash: cd: apps: No such file or directory
bitnami@ip-172-26-4-185:/opt/bitnami$ ls
apache   bncert-tool          bnsupport-tool  git      nami        properties.ini  stats
apache2  bnsupport            common          gonit    node        python          var
bncert   bnsupport-regex.ini  ctlscript.sh    mariadb  postgresql  scripts

附加信息: 16 GB RAM、4 个 vCPU、320 GB SSD

Django

弗吉尼亚州,A 区 (us-east-1a) 附加静态IP地址

最佳答案

这里是 Bitnami 工程师,

Django 解决方案中不再存在 apps 文件夹。您所遵循的指南不是由 Bitnami 维护的,因此它不是最新的。要在新的 Bitnami Django 解决方案中创建新项目,您需要运行这些命令

sudo mkdir -p /opt/bitnami/projects/PROJECT
sudo chown $USER /opt/bitnami/projects
django-admin startproject PROJECT /opt/bitnami/projects/PROJECT
cd /opt/bitnami/projects/PROJECT
python manage.py migrate
python manage.py startapp helloworld
python manage.py runserver

并访问端口 8000 以查看新的 hello world 项目。

您可以在我们的官方文档中了解更多信息

https://docs.bitnami.com/aws/infrastructure/django/get-started/start-django-project/

https://docs.bitnami.com/aws/infrastructure/django/get-started/deploy-django-project/

谢谢

关于python - Django Lightsail 上没有应用程序文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63680664/

相关文章:

python - 调整 Python 循环中的迭代量

python - 使用正则表达式设置变量

python - Haystack 对多对多字段的搜索不起作用

python - 使用 IAM 角色凭证通过 Python 卸载到 S3

python - 从 Django 查询中获取非唯一值

python - 在Python中调用外部命令

git - 使用 --amend 重写提交后 CodeCommit 失败

node.js - 如何在一个 EC2 实例上运行多个应用程序

django - 在 Django 中执行 PostgreSql 查询

django - 以表单形式访问管理模型实例