【发布时间】:2022-10-12 21:43:07
【问题描述】:
我已将 Django 项目部署到 Railway.app。我已经安装了铁路 CLI,但无法理解如何在其 CLI 中运行 python manage.py makemigrations 等以使 Django 运行。
我的笔记本电脑运行的是 Windows 10 家庭版。
我如何能?
【问题讨论】:
标签: django deployment command-line-interface
我已将 Django 项目部署到 Railway.app。我已经安装了铁路 CLI,但无法理解如何在其 CLI 中运行 python manage.py makemigrations 等以使 Django 运行。
我的笔记本电脑运行的是 Windows 10 家庭版。
我如何能?
【问题讨论】:
标签: django deployment command-line-interface
您可以按照文档中指示的步骤进行操作:https://docs.railway.app/develop/cli
从项目的位置运行命令: 铁路登录—— 铁路链接 yourprojectId -- 铁路运行 python manage.py makemigrations
【讨论】:
你可以通过使用railway run (command to be executed)来做到这一点
例如创建一个超级用户,使用
railway run python manage.py createsuperuser
在这里查看这篇文章[https://dev.to/mr_破坏性/django-postgresql-deployment-on-railway-app-d54]
PS:确保您与生产环境位于同一目录中,因为它将在本地和生产环境中运行。
【讨论】: