### Install SQLModel Example Requirements Source: https://github.com/jowilf/starlette-admin/blob/main/examples/sqlmodel/README.md Install the necessary Python packages for the SQLModel example. ```shell pip install -r 'examples/sqlmodel/requirements.txt' ``` -------------------------------- ### Install requirements Source: https://github.com/jowilf/starlette-admin/blob/main/examples/auth/README.md Install the necessary Python packages for the authentication example. ```shell pip install -r 'examples/auth/requirements.txt' ``` -------------------------------- ### Install requirements Source: https://github.com/jowilf/starlette-admin/blob/main/examples/babel/README.md Install the necessary dependencies for the Babel example. ```shell pip install -r 'examples/babel/requirements.txt' ``` -------------------------------- ### Install requirements Source: https://github.com/jowilf/starlette-admin/blob/main/examples/odmantic/README.md Install the necessary dependencies for the Odmantic example. ```shell pip install -r 'examples/odmantic/requirements.txt' ``` -------------------------------- ### Install Project Requirements Source: https://github.com/jowilf/starlette-admin/blob/main/examples/custom-backend/README.md Install the necessary Python packages for the custom backend example. Ensure your virtual environment is activated. ```shell pip install -r 'examples/custom-backend/requirements.txt' ``` -------------------------------- ### Install requirements Source: https://github.com/jowilf/starlette-admin/blob/main/examples/sqla_multiple_pks/README.md Install the necessary Python packages for the multiple primary keys example. ```shell pip install -r 'examples/sqla_multiple_pks/requirements.txt' ``` -------------------------------- ### Install Requirements Source: https://github.com/jowilf/starlette-admin/blob/main/examples/custom_actions/README.md Install the necessary Python packages for the custom actions example. ```shell pip install -r 'examples/custom_actions/requirements.txt' ``` -------------------------------- ### Install requirements Source: https://github.com/jowilf/starlette-admin/blob/main/examples/mongoengine/README.md Install the necessary dependencies for the MongoEngine example. ```shell pip install -r 'examples/mongoengine/requirements.txt' ``` -------------------------------- ### Run the application Source: https://github.com/jowilf/starlette-admin/blob/main/examples/beanie/README.md Start the development server using Uvicorn. ```shell uvicorn examples.beanie.app:app ``` -------------------------------- ### Install Requirements Source: https://github.com/jowilf/starlette-admin/blob/main/examples/sqla/README.md Install the necessary Python packages for the SQLAlchemy example. ```shell pip install -r 'examples/sqla/requirements.txt' ``` -------------------------------- ### Run the application Source: https://github.com/jowilf/starlette-admin/blob/main/examples/sqla_multiple_pks/README.md Start the application server using Uvicorn. ```shell uvicorn examples.sqla_multiple_pks.app:app ``` -------------------------------- ### Install requirements Source: https://github.com/jowilf/starlette-admin/blob/main/examples/beanie/README.md Install the necessary dependencies for the Beanie example. ```shell pip install -r 'examples/beanie/requirements.txt' ``` -------------------------------- ### Install Project Requirements Source: https://github.com/jowilf/starlette-admin/blob/main/examples/sqla-file/README.md Install the necessary Python packages for the SQLAlchemy file upload example. This command reads the requirements from the specified file. ```shell pip install -r 'examples/sqla-file/requirements.txt' ``` -------------------------------- ### Run the Application Source: https://github.com/jowilf/starlette-admin/blob/main/examples/sqla-pydantic/README.md Start the Starlette application using Uvicorn to run the example. ```shell uvicorn examples.sqla-pydantic.app:app ``` -------------------------------- ### Preview Documentation Locally Source: https://github.com/jowilf/starlette-admin/blob/main/CONTRIBUTING.md Start a local server to preview documentation changes. ```shell hatch run docs:serve ``` -------------------------------- ### Run the application Source: https://github.com/jowilf/starlette-admin/blob/main/examples/babel/README.md Start the Uvicorn server to serve the application. ```shell uvicorn examples.babel.app:app ``` -------------------------------- ### Run the application Source: https://github.com/jowilf/starlette-admin/blob/main/examples/auth/README.md Start the Uvicorn server to serve the admin application. ```shell uvicorn examples.auth.app:app ``` -------------------------------- ### Install Requirements Source: https://github.com/jowilf/starlette-admin/blob/main/examples/sqla-pydantic/README.md Install the necessary Python packages for the SQLAlchemy Pydantic example. ```shell pip install -r 'examples/sqla-pydantic/requirements.txt' ``` -------------------------------- ### Initialize Starlette-Admin with Database Backends Source: https://github.com/jowilf/starlette-admin/blob/main/docs/tutorials/basic/index.md Examples of configuring the admin interface for different ORM/ODM backends. Ensure the respective database driver is installed and the connection engine is properly initialized. ```python from sqlalchemy import create_engine from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column from starlette.applications import Starlette from starlette_admin.contrib.sqla import Admin, ModelView engine = create_engine("sqlite:///basic.db", connect_args={"check_same_thread": False}) class Base(DeclarativeBase): pass class Todo(Base): __tablename__ = "todo" id: Mapped[int] = mapped_column(primary_key=True) title: Mapped[str] done: Mapped[bool] Base.metadata.create_all(engine) app = Starlette() # or app = FastAPI() # Create an empty admin interface admin = Admin(engine, title="Tutorials: Basic") # Add view admin.add_view(ModelView(Todo, icon="fas fa-list")) # Mount admin to your app admin.mount_to(app) ``` ```python from typing import Optional from sqlalchemy import create_engine from sqlmodel import Field, SQLModel from starlette.applications import Starlette from starlette_admin.contrib.sqlmodel import Admin, ModelView engine = create_engine("sqlite:///basic.db", connect_args={"check_same_thread": False}) class Todo(SQLModel, table=True): id: Optional[int] = Field(default=None, primary_key=True) title: str done: bool SQLModel.metadata.create_all(engine) app = Starlette() # or app = FastAPI() # Create an empty admin interface admin = Admin(engine, title="Tutorials: Basic") # Add view admin.add_view(ModelView(Todo, icon="fas fa-list")) # Mount admin to your app admin.mount_to(app) ``` ```python import mongoengine as db from mongoengine import connect, disconnect from starlette.applications import Starlette from starlette_admin.contrib.mongoengine import Admin, ModelView class Todo(db.Document): title = db.StringField() done = db.BooleanField() app = Starlette( on_startup=[lambda: connect("basic")], on_shutdown=[disconnect], ) # Create an empty admin interface admin = Admin(title="Tutorials: Basic") # Add view admin.add_view(ModelView(Todo, icon="fas fa-list")) # Mount admin to your app admin.mount_to(app) ``` ```python from odmantic import AIOEngine, Model from starlette.applications import Starlette from starlette_admin.contrib.odmantic import Admin, ModelView engine = AIOEngine() class Todo(Model): title: str done: bool app = Starlette() # Create an empty admin interface admin = Admin(engine, title="Tutorials: Basic") # Add views admin.add_view(ModelView(Todo, icon="fas fa-list")) # Mount app admin.mount_to(app) ``` -------------------------------- ### Basic SQLAlchemy Example Source: https://github.com/jowilf/starlette-admin/blob/main/docs/index.md This example demonstrates setting up a basic admin interface with a SQLAlchemy model. Ensure your database and models are defined before initializing the Admin class. ```python from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import Mapped, mapped_column from starlette.applications import Starlette from starlette_admin.contrib.sqla import Admin, ModelView Base = declarative_base() engine = create_engine("sqlite:///test.db", connect_args={"check_same_thread": False}) # Define your model class Post(Base): __tablename__ = "posts" id: Mapped[int] = mapped_column(primary_key=True) title: Mapped[str] Base.metadata.create_all(engine) app = Starlette() # FastAPI() # Create admin admin = Admin(engine, title="Example: SQLAlchemy") # Add view admin.add_view(ModelView(Post)) # Mount admin to your app admin.mount_to(app) ``` -------------------------------- ### Install dependencies Source: https://github.com/jowilf/starlette-admin/blob/main/examples/authlib/README.md Install the required packages listed in the requirements file. ```shell pip install -r 'examples/authlib/requirements.txt' ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/jowilf/starlette-admin/blob/main/docs/tutorials/basic/index.md Installs all Python dependencies listed in the requirements.txt file. ```shell pip install -r requirements.txt ``` -------------------------------- ### Install Starlette-Admin with FastAPI and SQLAlchemy Source: https://github.com/jowilf/starlette-admin/blob/main/docs/tutorials/basic/index.md Example of adding FastAPI to the requirements for a Starlette-Admin project. ```requirements fastapi starlette-admin s sqlalchemy uvicorn ``` -------------------------------- ### Install Hatch Source: https://github.com/jowilf/starlette-admin/blob/main/CONTRIBUTING.md Install the Hatch dependency and packaging manager globally using pip. ```shell pip install hatch ``` -------------------------------- ### Setup Database Connection Source: https://github.com/jowilf/starlette-admin/blob/main/examples/beanie/README.md Configure the MongoDB connection URI via environment variable. ```shell export MONGO_URI="mongodb://localhost:27017" ``` -------------------------------- ### Install starlette-admin Source: https://github.com/jowilf/starlette-admin/blob/main/README.md Use pip or poetry to add the package to your project environment. ```shell $ pip install starlette-admin ``` ```shell $ poetry add starlette-admin ``` -------------------------------- ### Run the Application Source: https://github.com/jowilf/starlette-admin/blob/main/examples/custom_actions/README.md Start the Starlette-Admin application using Uvicorn. A SQLite database will be populated on the first run. ```shell uvicorn examples.custom_actions.app:app ``` -------------------------------- ### Install Pre-commit Hooks Source: https://github.com/jowilf/starlette-admin/blob/main/CONTRIBUTING.md Configure git hooks to ensure code formatting before commits. ```shell pre-commit install ``` -------------------------------- ### Configure ORM Backends Source: https://context7.com/jowilf/starlette-admin/llms.txt Examples for integrating SQLModel, MongoEngine, ODMantic, and Beanie backends with Starlette-Admin. ```python # SQLModel Backend from sqlmodel import SQLModel, Field from sqlalchemy import create_engine from starlette_admin.contrib.sqlmodel import Admin, ModelView class Hero(SQLModel, table=True): id: int = Field(default=None, primary_key=True) name: str = Field(min_length=2) secret_name: str age: int = Field(ge=0) engine = create_engine("sqlite:///heroes.db") admin = Admin(engine) admin.add_view(ModelView(Hero)) # MongoEngine Backend import mongoengine as db from starlette_admin.contrib.mongoengine import Admin, ModelView db.connect("mydatabase") class Article(db.Document): title = db.StringField(max_length=200, required=True) content = db.StringField() tags = db.ListField(db.StringField(max_length=50)) created_at = db.DateTimeField() admin = Admin() admin.add_view(ModelView(Article)) # ODMantic Backend from odmantic import AIOEngine, Model, Field from starlette_admin.contrib.odmantic import Admin, ModelView class Product(Model): name: str = Field(min_length=2) price: float = Field(ge=0) description: str = "" engine = AIOEngine() admin = Admin(engine) admin.add_view(ModelView(Product)) # Beanie Backend from beanie import Document from starlette_admin.contrib.beanie import Admin, ModelView class Task(Document): title: str completed: bool = False class Settings: name = "tasks" admin = Admin() admin.add_view(ModelView(Task)) ``` -------------------------------- ### Install Starlette-Admin with Poetry Source: https://github.com/jowilf/starlette-admin/blob/main/docs/index.md Use this command to add the starlette-admin package to your project using Poetry. ```shell $ poetry add starlette-admin ``` -------------------------------- ### Translate Messages Example Source: https://github.com/jowilf/starlette-admin/blob/main/CONTRIBUTING.md Example of a PO file entry for message translation. ```po msgid "Are you sure you want to delete selected items?" msgstr "Êtes-vous sûr de vouloir supprimer ces éléments?" ``` -------------------------------- ### Run Starlette Application Source: https://github.com/jowilf/starlette-admin/blob/main/examples/sqla/README.md Start the Starlette application with SQLAlchemy integration using uvicorn. ```shell uvicorn examples.sqla.app:app ``` -------------------------------- ### Install Starlette-Admin with PIP Source: https://github.com/jowilf/starlette-admin/blob/main/docs/index.md Use this command to install the starlette-admin package using pip. ```shell $ pip install starlette-admin ``` -------------------------------- ### Run the Starlette-Admin Application Source: https://github.com/jowilf/starlette-admin/blob/main/examples/custom-backend/README.md Start the Starlette-Admin application using Uvicorn. This command assumes you are in the root directory of the cloned repository and the virtual environment is active. ```shell uvicorn examples.custom-backend.app:app ``` -------------------------------- ### Install Starlette-Admin with SQLModel Source: https://github.com/jowilf/starlette-admin/blob/main/docs/tutorials/basic/index.md Specifies dependencies for a Starlette-Admin project using SQLModel. ```requirements starlette-admin sqlmodel uvicorn ``` -------------------------------- ### Install Starlette-Admin with ODMantic Source: https://github.com/jowilf/starlette-admin/blob/main/docs/tutorials/basic/index.md Specifies dependencies for a Starlette-Admin project using ODMantic. ```requirements starlette-admin odmantic uvicorn ``` -------------------------------- ### Run Starlette-Admin SQLModel Application Source: https://github.com/jowilf/starlette-admin/blob/main/examples/sqlmodel/README.md Start the Starlette-Admin application with SQLModel integration using uvicorn. ```shell uvicorn examples.sqlmodel.app:app ``` -------------------------------- ### Install Starlette-Admin with MongoEngine Source: https://github.com/jowilf/starlette-admin/blob/main/docs/tutorials/basic/index.md Specifies dependencies for a Starlette-Admin project using MongoEngine. ```requirements starlette-admin mongoengine uvicorn ``` -------------------------------- ### Mounting Admin with Database Backends Source: https://github.com/jowilf/starlette-admin/blob/main/docs/user-guide/getting-started/index.md Examples for integrating Starlette-Admin using SQLAlchemy, SQLModel, MongoEngine, or ODMantic. Ensure the appropriate contrib module is imported for the chosen database. ```python from sqlalchemy import create_engine from starlette.applications import Starlette from starlette_admin.contrib.sqla import Admin, ModelView from .models import Post, User engine = create_engine("sqlite:///test.db", connect_args={"check_same_thread": False}) app = Starlette() # FastAPI() admin = Admin(engine) admin.add_view(ModelView(User)) admin.add_view(ModelView(Post)) admin.mount_to(app) ``` ```python from sqlalchemy import create_engine from starlette.applications import Starlette from starlette_admin.contrib.sqlmodel import Admin, ModelView from .models import Post, User engine = create_engine("sqlite:///test.db", connect_args={"check_same_thread": False}) app = Starlette() # FastAPI() admin = Admin(engine) admin.add_view(ModelView(User)) admin.add_view(ModelView(Post)) admin.mount_to(app) ``` ```python from starlette.applications import Starlette from starlette_admin.contrib.mongoengine import Admin, ModelView from .models import Post, User app = Starlette() # FastAPI() admin = Admin() admin.add_view(ModelView(User)) admin.add_view(ModelView(Post)) admin.mount_to(app) ``` ```python from odmantic import AIOEngine from starlette.applications import Starlette from starlette_admin.contrib.odmantic import Admin, ModelView from .models import Post, User engine = AIOEngine() app = Starlette() # FastAPI() admin = Admin(engine) admin.add_view(ModelView(User)) admin.add_view(ModelView(Post)) admin.mount_to(app) ``` -------------------------------- ### Install Starlette-Admin with SQLAlchemy Source: https://github.com/jowilf/starlette-admin/blob/main/docs/tutorials/basic/index.md Specifies dependencies for a Starlette-Admin project using SQLAlchemy. ```requirements starlette-admin s sqlalchemy uvicorn ``` -------------------------------- ### Implement a Custom Authentication Provider Source: https://github.com/jowilf/starlette-admin/blob/main/docs/user-guide/authentication/index.md Create a custom authentication provider by inheriting from AuthProvider and implementing methods for authentication, user retrieval, login/logout rendering, and setup. ```python from typing import Optional from starlette.datastructures import URL from starlette.requests import Request from starlette.responses import RedirectResponse, Response from starlette.routing import Route from starlette_admin import BaseAdmin from starlette_admin.auth import ( AdminUser, AuthProvider, login_not_required, ) from authlib.integrations.starlette_client import OAuth from .config import AUTH0_CLIENT_ID, AUTH0_CLIENT_SECRET, AUTH0_DOMAIN oauth = OAuth() oauth.register( "auth0", client_id=AUTH0_CLIENT_ID, client_secret=AUTH0_CLIENT_SECRET, client_kwargs={ "scope": "openid profile email", }, server_metadata_url=f"https://{AUTH0_DOMAIN}/.well-known/openid-configuration", ) class MyAuthProvider(AuthProvider): async def is_authenticated(self, request: Request) -> bool: if request.session.get("user", None) is not None: request.state.user = request.session.get("user") return True return False def get_admin_user(self, request: Request) -> Optional[AdminUser]: user = request.state.user return AdminUser( username=user["name"], photo_url=user["picture"], ) async def render_login(self, request: Request, admin: BaseAdmin): """Override the default login behavior to implement custom logic.""" auth0 = oauth.create_client("auth0") redirect_uri = request.url_for( admin.route_name + ":authorize_auth0" ).include_query_params(next=request.query_params.get("next")) return await auth0.authorize_redirect(request, str(redirect_uri)) async def render_logout(self, request: Request, admin: BaseAdmin) -> Response: """Override the default logout to implement custom logic""" request.session.clear() return RedirectResponse( url=URL(f"https://{AUTH0_DOMAIN}/v2/logout").include_query_params( returnTo=request.url_for(admin.route_name + ":index"), client_id=AUTH0_CLIENT_ID, ) ) @login_not_required async def handle_auth_callback(self, request: Request): auth0 = oauth.create_client("auth0") token = await auth0.authorize_access_token(request) request.session.update({"user": token["userinfo"]}) return RedirectResponse(request.query_params.get("next")) def setup_admin(self, admin: "BaseAdmin"): super().setup_admin(admin) """add custom authentication callback route""" admin.routes.append( Route( "/auth0/authorize", self.handle_auth_callback, methods=["GET"], name="authorize_auth0", ) ) ``` -------------------------------- ### Implement Username and Password Authentication Provider Source: https://github.com/jowilf/starlette-admin/blob/main/docs/user-guide/authentication/index.md Extend AuthProvider to handle username and password validation, session management, and user-specific admin configurations. This example demonstrates login, authentication checks, and logout logic. ```python from starlette.requests import Request from starlette.responses import Response from starlette_admin.auth import AdminConfig, AdminUser, AuthProvider from starlette_admin.exceptions import FormValidationError, LoginFailed users = { "admin": { "name": "Admin", "avatar": "admin.png", "company_logo_url": "admin.png", "roles": ["read", "create", "edit", "delete", "action_make_published"], }, "johndoe": { "name": "John Doe", "avatar": None, # user avatar is optional "roles": ["read", "create", "edit", "action_make_published"], }, "viewer": {"name": "Viewer", "avatar": "guest.png", "roles": ["read"]} } class UsernameAndPasswordProvider(AuthProvider): """ This is only for demo purpose, it's not a better way to save and validate user credentials """ async def login( self, username: str, password: str, remember_me: bool, request: Request, response: Response, ) -> Response: if len(username) < 3: """Form data validation""" raise FormValidationError( {"username": "Ensure username has at least 03 characters"} ) if username in users and password == "password": """Save `username` in session""" request.session.update({"username": username}) return response raise LoginFailed("Invalid username or password") async def is_authenticated(self, request) -> bool: if request.session.get("username", None) in users: """ Save current `user` object in the request state. Can be used later to restrict access to connected user. """ request.state.user = users.get(request.session["username"]) return True return False def get_admin_config(self, request: Request) -> AdminConfig: user = request.state.user # Retrieve current user # Update app title according to current_user custom_app_title = "Hello, " + user["name"] + "!" # Update logo url according to current_user custom_logo_url = None if user.get("company_logo_url", None): custom_logo_url = request.url_for("static", path=user["company_logo_url"]) return AdminConfig( app_title=custom_app_title, logo_url=custom_logo_url, ) def get_admin_user(self, request: Request) -> AdminUser: user = request.state.user # Retrieve current user photo_url = None if user["avatar"] is not None: photo_url = request.url_for("static", path=user["avatar"]) return AdminUser(username=user["name"], photo_url=photo_url) async def logout(self, request: Request, response: Response) -> Response: request.session.clear() return response ``` -------------------------------- ### Run the Starlette Application Source: https://github.com/jowilf/starlette-admin/blob/main/examples/sqla-file/README.md Run the Starlette application using uvicorn. This command starts the web server to serve the admin interface and handle file uploads. ```shell uvicorn examples.sqla-file.app:app ``` -------------------------------- ### SQLAlchemy Model with File and Image Fields Source: https://github.com/jowilf/starlette-admin/blob/main/docs/user-guide/files/index.md Define SQLAlchemy models with ImageField for thumbnails and FileField for general file storage. Ensure you have the 'sqlalchemy-file' library installed. ```python from sqlalchemy import Column, Integer, String from sqlalchemy.orm import declarative_base from sqlalchemy_file import FileField, ImageField from starlette_admin.contrib.sqla import ModelView Base = declarative_base() class Book(Base): __tablename__ = "book" id = Column(Integer, autoincrement=True, primary_key=True) title = Column(String(50), unique=True) cover = Column(ImageField(thumbnail_size=(128, 128))) content = Column(FileField) class BookView(ModelView): pass admin.add_view(BookView(Book)) ``` -------------------------------- ### Define Custom Row Actions in Starlette-Admin Source: https://github.com/jowilf/starlette-admin/blob/main/docs/user-guide/actions/index.md Example of defining a custom row action 'make_published' with a confirmation dialog and a form for user input. It also includes a link row action 'go_to_example'. ```python from typing import Any from starlette.datastructures import FormData from starlette.requests import Request from starlette_admin._types import RowActionsDisplayType from starlette_admin.actions import link_row_action, row_action from starlette_admin.contrib.sqla import ModelView from starlette_admin.exceptions import ActionFailed class ArticleView(ModelView): ... row_actions = ["view", "edit", "go_to_example", "make_published", "delete"] # edit, view and delete are provided by default row_actions_display_type = RowActionsDisplayType.ICON_LIST # RowActionsDisplayType.DROPDOWN @row_action( name="make_published", text="Mark as published", confirmation="Are you sure you want to mark this article as published ?", icon_class="fas fa-check-circle", submit_btn_text="Yes, proceed", submit_btn_class="btn-success", action_btn_class="btn-info", form="""
""", ) async def make_published_row_action(self, request: Request, pk: Any) -> str: # Write your logic here data: FormData = await request.form() user_input = data.get("example-text-input") if ...: # Display meaningfully error raise ActionFailed("Sorry, We can't proceed this action now.") # Display successfully message return "The article was successfully marked as published" @link_row_action( name="go_to_example", text="Go to example.com", icon_class="fas fa-arrow-up-right-from-square", ) def go_to_example_row_action(self, request: Request, pk: Any) -> str: return f"https://example.com/?pk={pk}" ``` -------------------------------- ### Create Virtual Environment and Activate (Windows) Source: https://github.com/jowilf/starlette-admin/blob/main/docs/tutorials/basic/index.md Sets up a Python virtual environment for the project on Windows. ```shell python -m venv env env\Scripts\activate ``` -------------------------------- ### Create Virtual Environment and Activate (macOS/Linux) Source: https://github.com/jowilf/starlette-admin/blob/main/docs/tutorials/basic/index.md Sets up a Python virtual environment for the project on macOS or Linux. ```shell python -m venv env source env/bin/activate ``` -------------------------------- ### Update Datatables JSON Example Source: https://github.com/jowilf/starlette-admin/blob/main/CONTRIBUTING.md Example of the JSON structure for datatable localization. ```json5 { // ... "starlette-admin": { "buttons": { "export": "Export" }, "conditions": { "false": "Faux", "true": "Vrai", "empty": "Vide", "notEmpty": "Non vide" } }, // ... } ``` -------------------------------- ### Initialize Admin Configuration Source: https://github.com/jowilf/starlette-admin/blob/main/docs/user-guide/configurations/admin/index.md Configures the Admin interface with custom branding, paths, and authentication providers. ```python admin = Admin( title="SQLModel Admin", base_url="/admin", route_name="admin", statics_dir="statics/admin", templates_dir="templates/admin", logo_url="`https`://preview.tabler.io/static/logo-white.svg", login_logo_url="`https`://preview.tabler.io/static/logo.svg", index_view=CustomView(label="Home", icon="fa fa-home", path="/home", template_path="home.html"), auth_provider=MyAuthProvider(login_path="/sign-in", logout_path="/sign-out"), middlewares=[], debug=False, i18n_config = I18nConfig(default_locale="en") ) ``` -------------------------------- ### Initialize New Locale Source: https://github.com/jowilf/starlette-admin/blob/main/CONTRIBUTING.md Run the initialization script to prepare a new locale directory and files. ```shell # replace