python - manage.py 标志强制执行无人值守命令?

标签 python django django-manage.py

我正在阅读本教程:Installing and Configuring Graphite and Statsd on an Ubuntu 12.04 VPS

我正在努力使一切皆有可能实现自动化,然后本教程中有一个步骤让我抓狂:

Next, we will configure the Graphite database. Go to the Graphite webapp directory and run the database script:

cd /opt/graphite/webapp/graphite/
sudo python manage.py syncdb

如您所见,我们必须运行 manage.py 并且当我运行 syncdb 时询问有关创建 super 用户的信息。我怎样才能避免这种情况?我想运行这些发送所有参数来制作一个自动脚本。

有什么想法吗?

最佳答案

您可以使用 the --noinput argument禁用 the syncdb command 的提示.

--noinput

Use the --noinput option to suppress all user prompting, such as “Are you sure?” confirmation messages. This is useful if django-admin.py is being executed as an unattended, automated script.

关于python - manage.py 标志强制执行无人值守命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23202805/

相关文章:

python - 清理 python 中的嵌套 for 循环

python - 如何在 DRF 中序列化自定义用户模型

python - Scrapy - 动态等待页面加载 - selenium + scrapy

python - heroku 连接 mysql 数据库

python - Django的manage.py显示旧命令

python - 用于 Django 模型的 manage.py sql 命令 - Django

python - 在 Keras 模型中删除然后插入一个新的中间层

Django Rest Framework - 标记路由的额外操作

python - Django 错误 TypeError at/admin/'set' 对象不可逆

django - 调试 Django Manage.py 自定义命令 Pycharm