Project Setup#
🔥 Hot Tips
- Use
uvfor efficient dependency management. - Use a good IDE like PyCharm or IntelliJ
Initialization#
Create a new project folder, add Tina4, initialize structure, and start the server:
bash
uv init <project-name>cd <project-name>uv add tina4-pythonuv run tina4 init .uv run tina4 startuv init: Creates the project directory with a virtual environment.uv add: Installstina4-pythonas a dependency.tina4 init .: Sets up Tina4 folders (e.g.,src/routes,src/templates) and files in the current directory.tina4 start: Launches the development webserver.
Default Webserver#
Access the server at http://localhost:7145. Customize the listening address/port as the first argument:
bash
# Loopback on port 8001uv run tina4 start 8001# All interfaces on port 8001uv run tina4 start 0.0.0.0:8001Debugging#
Debug level defaults to All for development. Set TINA4_DEBUG_LEVEL=Info environment variable for production to reduce verbosity. Logs rotate automatically in the logs/ directory to prevent excessive storage use.