User Management in Enferno v2.0

One of the cool features in Enferno 2.0 is that it comes with a full user management system pre-configured for you.

Default URLs for common user account functions

The default URLs are the same that ship with Flask-Security

Registration: /register

Default Registration Page

Login: /login

Logged-in Account Management:

/dashboard

/settings

Enabling Mail features (useful for registration)

in settings.py you will find the settings to enable Flask-Mail, this is important to send registration confirmation email or password reset links:

settings.py - Flask Mail settings

Powerful Command-line tools to manage users

Enferno ships with a powerful click commands to help you take full control of your users from the command line.

Create a User

$ flask create

This command will take you through the steps to create a new user to the system, the user will be activated by default.

Reset a User password

$ flask reset

This command allows you to reset the password of a user (specified by his Email address)

Create a Role

$ flask roles create <role_name>

Enferno comes with a built-in role (access level) feature, this is cool because you could then restrict access to specific routes/pages using the simple decorator:

from flask_security.decorators import roles_required

@roles_required('editor')

Assign a role to a user

$ flask add-role

This allows you to add a role to a user (specified by Email), a role in Enferno is a simple string, if the role doesn't exist it will be created by default.

Remove a role from a user

$ flask roles remove <user@email.com> <role_name>

Customizing appearance and styles

Enferno ships with minimal css styles for user accounts and forms. to customize them further, feel free to edit the css file located at:

enferno/static/css/dashboard.css