Account Management

Introduction

Except for the management of ordinary users on the page, Spug also provides the manage.py user command for the management of administrator accounts.

Add Account

Add an account using the manage.py user add command, as shown below

  1. cd spug/spug_api
  2. source venv/bin/activate
  3. python manage.py user add -u admin -p 123 -n tom -s

Docker installation can execute the following command

  1. docker exec spug python3 /data/spug/spug_api/manage.py user add -u admin -p 123 -n tom -s

That command will create an account with a login name of admin, a password of 123, and a nickname of tom. Note the last -s parameter. If this parameter is carried, it means that the account is an administrator account. The administrator account can access all functional modules without any restrictions.

Reset Password

Using the manage.py user reset command to reset the account password, the usage is as follows

  1. cd spug/spug_api
  2. source venv/bin/activate
  3. python manage.py user reset -u admin -p abc

Docker installation can execute the following command

  1. docker exec spug python3 /data/spug/spug_api/manage.py user reset -u admin -p abc

That command will reset the password of the account with a login name of admin to abc.

Enable Account

When the login error count on the page exceeds 3 times, the account will automatically be disabled. Ordinary users can enable the account through System Management / Account Management on the page, but the administrator account needs to use the following command to enable it.

  1. cd spug/spug_api
  2. source venv/bin/activate
  3. python manage.py user enable -u admin

Docker installation can execute the following command

  1. docker exec spug python3 /data/spug/spug_api/manage.py user enable -u admin