Forums

Where to change web2py admin password

Hi, I haven't used it for a while and forgotten the admin pwd :/ On usual server it is set when starting, but here I don't see, where to set it?

Thanks for answer :)

The easiest way is to do it from the command line.

  • Start a bash console
  • Go to the directory where you installed web2py (probably just cd web2py)
  • Run the following (replacing APASSWORD with the new admin password):

-

python -c "from gluon.widget import console; console();"
python -c "import hashlib; print 'password=\"%s\"' % (hashlib.md5('APASSWORD').hexdigest(),)" > parameters_443.py

[edit: broke the instructions out into a list -- lots of readers were missing the fact they had to cd web2py]

I've followed these instructions and failed. After I've run those commands and have reloaded my web2py app at https://www.pythonanywhere.com/user/igorsavinkin/webapps/#tab_id_igorsavinkin_pythonanywhere_com still I can't open interface to enter a new password: error "403 Forbidden" - http://joxi.ru/YmEklV7h0vb8jA Neither that instruction has helped me.

Can you log in to the admin interface after running the code above? That code changes the password directly, you shouldn't need to go to a page to change the password after running it -- you should just be able to log right in.