Search code examples
pythondjangopythonanywhere

sudo: unknown user: root via PythonAnywhere


I'm using PythonAnywhere with Postgresql, and have run into several problems. When I try to do anything, such as python manage.py makemigrations, I get the following error :

sudo: unknown user: root

sudo: unable to initialize policy plugin

Also, I tried to use postgres -V, but I get command not found, and yet I can't use sudo to install it.

Finally, I'm also not sure what my UNIX password is, but all my permissions are denied to me.

Strangely, I've noticed the creation of a dead.letter file, which contains:

giles-liveconsole1 : Feb 17 09:25:05 : X : user NOT in sudoers ; TTY=unknown ; PWD=/home/X/X/X ; USER=X ; COMMAND=/bin/bash

giles-liveconsole2 : Feb 17 11:43:08 : X : user NOT in sudoers ; TTY=unknown ; PWD=/etc ; USER=#0 ; COMMAND=/usr/bin/vi /etc/passwd

giles-liveconsole2 : Feb 17 11:45:51 : X : user NOT in sudoers ; TTY=unknown ; PWD=/etc ; USER=#0 ; COMMAND=/usr/bin/vi /etc/passwd


Solution

  • The problem was within my settings.py - I wasn't pointing the project to the correct database settings - username and password. I changed the settings to reflect those of my pythonanywhere details, and then I could operate manage.py properly from there.