From 5948dceba7ff51172e418604f47f17c1c97206ea Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Fri, 18 Nov 2016 19:19:35 +0100 Subject: [PATCH] Cleanup web views and mention settings.ini in README.md --- README.md | 5 +++++ filestorage/web_views.py | 34 ---------------------------------- 2 files changed, 5 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 4c13ba2..37beabd 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,11 @@ export VENV=/path/to/venv python3 -m venv $VENV $VENV/bin/pip install -e . ``` + +##Adapt the configuration +Check the contents of `settings.ini` to define what interface the service shall bind to. +Also location for files and the shelve database can be configured in there. + ##Run the application ``` diff --git a/filestorage/web_views.py b/filestorage/web_views.py index 39e58f2..53ab685 100644 --- a/filestorage/web_views.py +++ b/filestorage/web_views.py @@ -8,37 +8,3 @@ from pyramid.view import view_config @view_config(route_name='home', renderer='templates/home.jinja2') def home_view(request): return dict() - # This is how params can be passed to the renderer - #return dict(name=request.matchdict['name']) - -""" -# /howdy?name=alice which links to the next view -@view_config(route_name='hello') -def hello_view(request): - name = request.params.get('name', 'No Name') - body = '

Hi %s, this redirects

' - # cgi.escape to prevent Cross-Site Scripting (XSS) [CWE 79] - return Response(body % cgi.escape(name)) - - -# /goto which issues HTTP redirect to the last view -@view_config(route_name='redirect') -def redirect_view(request): - return HTTPFound(location="/problem") - - -# /problem which causes a site error -@view_config(route_name='exception') -def exception_view(request): - raise Exception() - -# /get which shows a file by its uuid -@view_config(route_name='get_file') -def get_file_view(request): - body = 'Param: $(uuid)' % request.matchdict - return Response(body) - -view_config(route_name='home', renderer='json') -def hello_json(request): - return [1, 2, 3] -"""