# Manage users with manage.py The {file}`manage.py` script includes commands for user management. Use these commands to automate managing users from the command line. All users-related commands are available under the `python manage.py fw users` namespace. ## Create users You can create users with the {file}`manage.py` script. There are different ways to create users depending on what approach you want to take. ### Create a user interactively ````{tabbed} Debian ```{code} bash poetry run python manage.py fw users create ``` ```` ````{tabbed} Docker ```{code} bash docker-compose run --rm api python manage.py fw users create ``` ```` ### Create a user with a random password ````{tabbed} Debian ```{code} bash poetry run python manage.py fw users create --username --email -p "" ``` ```` ````{tabbed} Docker ```{code} bash docker-compose run --rm api python manage.py fw users create --username --email -p "" ``` ```` ### Create a user with a password set from an environment variable ````{tabbed} Debian ```{code} bash export FUNKWHALE_CLI_USER_PASSWORD= poetry run python manage.py fw users create --username --email ``` ```` ````{tabbed} Docker ```{code} bash export FUNKWHALE_CLI_USER_PASSWORD= docker-compose run --rm api python manage.py fw users create --username --email ``` ```` There are extra options for user configuration, such as quota and {term}`permissions`. Check the command help for more options. ````{tabbed} Debian ```{code} bash poetry run python manage.py fw users --help ``` ```` ````{tabbed} Docker ```{code} bash docker-compose run --rm api python manage.py fw users --help ``` ```` ## Update users You can update user accounts using the {file}`manage.py` script. Update commands are available under the `python manage.py fw users set` namespace. ### Set upload quota for a user ````{tabbed} Debian ```{code} bash poetry run python manage.py fw users set --upload-quota 500 ``` ```` ````{tabbed} Docker ```{code} bash docker-compose run --rm api python manage.py fw users set --upload-quota 500 ``` ```` ### Make users staff members ````{tabbed} Debian ```{code} bash poetry run python manage.py fw users set --staff --superuser ``` ```` ````{tabbed} Docker ```{code} bash docker-compose run --rm api python manage.py fw users set --staff --superuser ``` ```` ### Remove a user's staff privileges ````{tabbed} Debian ```{code} bash poetry run python manage.py fw users set --no-staff --no-superuser ``` ```` ````{tabbed} Docker ```{code} bash docker-compose run --rm api python manage.py fw users set --no-staff --no-superuser ``` ```` ### Give a user moderation permissions ````{tabbed} Debian ```{code} bash poetry run python manage.py fw users set --permission-moderation ``` ```` ````{tabbed} Docker ```{code} bash docker-compose run --rm api python manage.py fw users set --permission-moderation ``` ```` ### Reset a user's password ````{tabbed} Debian ```{code} bash poetry run python manage.py fw users set --password "" ``` ```` ````{tabbed} Docker ```{code} bash docker-compose run --rm api python manage.py fw users set --password "" ``` ```` ### Reset a user's password using an environment variable ````{tabbed} Debian ```{code} bash export FUNKWHALE_CLI_USER_UPDATE_PASSWORD= poetry run python manage.py fw users set ``` ```` ````{tabbed} Docker ```{code} bash export FUNKWHALE_CLI_USER_UPDATE_PASSWORD= docker-compose run --rm api python manage.py fw users set ``` ```` There are extra options for updating users. Check the command help for more options. ````{tabbed} Debian ```{code} bash poetry run python manage.py fw users set --help ``` ```` ````{tabbed} Docker ```{code} bash docker-compose run --rm api python manage.py fw users set --help ``` ```` ## Delete users ### Delete a user's account but leave a reference to them in the database This prevents the same username being used in future. ````{tabbed} Debian ```{code} py poetry run python manage.py fw users rm ``` ```` ````{tabbed} Docker ```{code} py docker-compose run --rm api python manage.py fw users rm ``` ```` ### Delete a user's account, including all references in the database This means the username can be reused. ````{tabbed} Debian ```{code} py poetry run python manage.py fw users rm --hard ``` ```` ````{tabbed} Docker ```{code} py docker-compose run --rm api python manage.py fw users rm --hard ``` ```` There are extra options for deleting users. Check the command help for more options. ````{tabbed} Debian ```{code} bash poetry run python manage.py fw users rm --help ``` ```` ````{tabbed} Docker ```{code} bash docker-compose run --rm api python manage.py fw users rm --help ``` ````