Skip to main content
fastdaisy-admin provides an optional authentication system for securing the admin panel. To enable authentication mode, set authentication=True when initializing the Admin instance. If you are satisfied with the default User table, you can create a superuser by running the following command:
And also, you can provide file path which must contain Admin instance as
filepath: user/app.py

Working with User table

By default, the User table is automatically created when you run the above command. However, it is not recommended to use the built-in User model if you plan to establish relationships with other tables or need to add custom fields. The default User table contains the following fields:
  • id
  • username
  • hashed_password
  • is_active
  • is_superuser
  • date_joined
If you need a customized User model, you can override it as shown below:
In the Admin class, ensure that:
  • authentication=True is set to enable authentication.
  • auth_model=User is passed if you are using a custom User model.

Creating superuser

To create a superuser, run:
When executed:
  1. The User table will be created automatically (if it does not already exist).
  2. You will be prompted to enter a username and password.
  3. A superuser account will then be created.
To access the admin interface, log in using valid credentials on the login page. Authentication is managed internally using session cookies, which remain valid for two weeks. You will see an Edit Profile button in the navigation bar only when you register a user admin as shown below:
To logout, click the Logout button located in the navigation bar. This will clear the session data from your cookies.