Development environment setup
Before debugging, ensure you have a proper development environment configured with your virtualenv activated and all dependencies installed.Requirements
- Python 3.12.x or 3.13.x
- SQLite 3.35.0+ (recommended: 3.47.0)
- Redis (optional, for moderation features)
- A configured
config.tomlandboards.toml
VS Code debugging
The recommended way to debug Ayase Quart is using VS Code with the Python debugger.Launch configuration
Create.vscode/launch.json with the following configuration:
Replace
path/to/ayase-quart with the actual path to your Ayase Quart installation.Using the debugger
Running without debugger
For quick testing without the debugger, you can run Ayase Quart directly:Development server
-w 2- 2 worker processes-b 127.0.0.1:9001- Bind to localhost port 9001
Configuration-based launch
You can also use a Hypercorn configuration file:Development mode features
Auto-reload
Enable auto-reload inconfig.toml to automatically restart the server when code changes:
Auto-reload is useful during development but should be disabled in production.
Disabling asset integrity checks
During active development with frequent JavaScript changes, you can disable integrity checks:ayaseq prep hashjs before deploying.
Testing mode
Set testing mode in configuration to show detailed error messages:Logging and debugging output
Application logs
Ayase Quart logs important events to stdout. When running in development, you’ll see:Database debugging
To debug database queries, you can add print statements in the query runners:Remove debug print statements before committing code.
Common debugging scenarios
Debugging routes
Set breakpoints in blueprint files underblueprints/web/ or blueprints/api/:
Debugging database queries
Set breakpoints indb/ module files to inspect query execution:
Debugging templates
Add debug output in Jinja2 templates:Debugging plugins
Check plugin loading by watching stdout during startup. If plugins aren’t loading:- Verify plugin files are in
plugins/search/orplugins/blueprints/ - Check that plugins implement the correct interface
- Ensure plugin configuration is enabled in
config.toml
Testing
Running tests
Ayase Quart includes a test suite. Run tests with pytest:Test configuration
Tests are configured inpyproject.toml:
Writing tests
Add test files to thetests/ directory. See existing tests in:
tests/unit/- Unit testssrc/ayase_quart/tests/- Integration tests
Troubleshooting
Database connection errors
MySQL access denied error:Port already in use
If port 9001 is already in use:Import errors
If you encounter import errors, ensure:- Virtual environment is activated
- Package is installed:
python -m pip install . - PYTHONPATH includes
src/directory
Redis connection errors
If moderation features fail:Performance profiling
Memory profiling
Use memory profiler to identify memory leaks:Request profiling
Add timing decorators to routes to measure performance:Getting help
If you encounter issues:- Check the GitHub issues
- Review the README.md for common setup problems
- Enable testing mode for detailed error messages
- Add logging to isolate the problem area