halp, why doesn't this work? getting http 404

modified:   app.py
	new file:   openapi.yaml
	modified:   requirements.txt
This commit is contained in:
Russell Ballestrini 2025-01-07 08:03:27 -05:00
parent 35268e6884
commit beb4f96d81
3 changed files with 71 additions and 4 deletions

20
app.py
View file

@ -524,9 +524,9 @@ def download_database_view(request):
download_filename = sanitize_filename_for_http_header(f"user_{user.id}.db")
response = Response(body=data, content_type="application/octet-stream")
response.headers[
"Content-Disposition"
] = f'attachment; filename="{download_filename}"'
response.headers["Content-Disposition"] = (
f'attachment; filename="{download_filename}"'
)
return response
@ -1005,7 +1005,19 @@ def main(global_config=None, **settings):
config.add_jinja2_renderer(".j2")
config.add_jinja2_search_path("templates", name=".j2")
# The Jinja2 filters are added via the event subscriber above
# Add settings for pyramid_openapi3
config.add_settings(
{
"pyramid_openapi3.spec": os.path.join(APP_DIR, "openapi.yaml"),
"pyramid_openapi3.enable_request_validation": True,
"pyramid_openapi3.enable_response_validation": False,
"pyramid_openapi3.route": "/openapi.yaml",
"pyramid_openapi3.ui_route": "/docs/",
}
)
# Include pyramid_openapi3
config.include("pyramid_openapi3")
# Set up SQLAlchemy
engine = create_engine(