Skip to content
tech-kev edited this page Mar 24, 2026 · 1 revision

CLI (manage.py)

SharedMoments includes a command-line tool for user management. This is useful for password resets, troubleshooting, or scripting.


Usage

Docker:

docker exec -it sharedmoments python manage.py <command>

Native:

cd /opt/SharedMoments
python manage.py <command>

Commands

list-users

List all users with their ID, name, email, and roles.

python manage.py list-users

Example output:

ID    Name                      E-Mail                              Roles
------------------------------------------------------------------------------------------
1     John Doe                  john@example.com                    Admin, User
2     Jane Doe                  jane@example.com                    User

Total: 2 user(s)

set-password

Set a new password for a user. If --password is omitted, you will be prompted to enter it interactively.

python manage.py set-password <email> [--password <new-password>]

Examples:

# Interactive (recommended — password is not visible in shell history)
python manage.py set-password john@example.com

# Inline
python manage.py set-password john@example.com --password "newpassword123"

update-user

Update user details like name, email, or birth date. Only the specified fields are changed.

python manage.py update-user <email> [--first-name X] [--last-name X] [--email X] [--birthdate YYYY-MM-DD]

Examples:

# Change name
python manage.py update-user john@example.com --first-name "John" --last-name "Smith"

# Change email
python manage.py update-user john@example.com --email "newemail@example.com"

# Change birth date
python manage.py update-user john@example.com --birthdate 1990-05-15

Clone this wiki locally