简体   繁体   English

sudo:未知用户:root 通过 PythonAnywhere

[英]sudo: unknown user: root via PythonAnywhere

I'm using PythonAnywhere with Postgresql, and have run into several problems.我在 Postgresql 中使用 PythonAnywhere,但遇到了几个问题。 When I try to do anything, such as python manage.py makemigrations , I get the following error :当我尝试做任何事情时,例如python manage.py makemigrations ,我收到以下错误:

sudo: unknown user: root须藤:未知用户:root

sudo: unable to initialize policy plugin sudo:无法初始化策略插件

Also, I tried to use postgres -V , but I get command not found , and yet I can't use sudo to install it.另外,我尝试使用postgres -V ,但我得到command not found ,但我无法使用sudo来安装它。

Finally, I'm also not sure what my UNIX password is, but all my permissions are denied to me.最后,我也不确定我的 UNIX 密码是什么,但是我的所有权限都被拒绝了。

Strangely, I've noticed the creation of a dead.letter file, which contains:奇怪的是,我注意到创建了一个dead.letter文件,其中包含:

giles-liveconsole1 : Feb 17 09:25:05 : X : user NOT in sudoers ; giles-liveconsole1:2 月 17 日 09:25:05:X:用户不在 sudoers 中; TTY=unknown ; TTY=未知; PWD=/home/X/X/X ;密码=/home/X/X/X ; USER=X ;用户=X ; COMMAND=/bin/bash命令=/bin/bash

giles-liveconsole2 : Feb 17 11:43:08 : X : user NOT in sudoers ; giles-liveconsole2:2 月 17 日 11:43:08:X:用户不在 sudoers 中; TTY=unknown ; TTY=未知; PWD=/etc ; PWD=/etc ; USER=#0 ;用户=#0 ; COMMAND=/usr/bin/vi /etc/passwd命令=/usr/bin/vi /etc/passwd

giles-liveconsole2 : Feb 17 11:45:51 : X : user NOT in sudoers ; giles-liveconsole2:2 月 17 日 11:45:51:X:用户不在 sudoers 中; TTY=unknown ; TTY=未知; PWD=/etc ; PWD=/etc ; USER=#0 ;用户=#0 ; COMMAND=/usr/bin/vi /etc/passwd命令=/usr/bin/vi /etc/passwd

In general, makemigrations should not be using sudo.一般来说,makemigrations 不应该使用 sudo。 If it is, then there's something in your django settings that's making it do that.如果是,那么您的 django 设置中有一些东西使它这样做。

You don't need to run postgres - it's already running.你不需要运行 postgres - 它已经在运行了。 See the Databases tab in your account for the connection details.有关连接详细信息,请参阅您帐户中的“数据库”选项卡。

The problem was within my settings.py - I wasn't pointing the project to the correct database settings - username and password.问题出在我的 settings.py 中 - 我没有将项目指向正确的数据库设置 - 用户名和密码。 I changed the settings to reflect those of my pythonanywhere details, and then I could operate manage.py properly from there.我更改了设置以反映我的 pythonanywhere 详细信息,然后我可以从那里正确操作 manage.py。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM