app.py
Main file, containing the FastAPI web-app definition and its routes.
Exception handling
Bases: HTTPException
Exception raised by the web-app.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
status_code |
int
|
HTTP code to return. |
required |
detail |
str
|
Error description. Defaults to |
required |
Source code in oblique/app.py
18 19 20 21 22 23 24 25 26 | |
Define the exception handler for HTMLException.
Source code in oblique/app.py
29 30 31 32 33 | |
Dependencies
Dependency, to make sure the received request is a HTMX request. If it's not a HTMX request, a 404 is returned.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request |
Request
|
Request to check. |
required |
Source code in oblique/app.py
39 40 41 42 43 44 45 46 47 | |
Routes
Main route, sending the home page.
Source code in oblique/app.py
50 51 52 53 | |
Favicon.
Source code in oblique/app.py
56 57 58 59 | |
Search route, to display the search results.
Source code in oblique/app.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
Catch-all route, if the user tries to access an unknown page, we display a 404.
Source code in oblique/app.py
78 79 80 81 82 83 | |