From d574b022096a234cf7d345f83edf82df0c32495c Mon Sep 17 00:00:00 2001 From: Anon Ray Date: Mon, 9 Jun 2014 16:44:47 +0530 Subject: [PATCH] Fix log path resolution; type of id in URL - Fix log file path resolution in configure_logging - Fix the type of arguments available in sweet endpoints --- swtstore/application.py | 6 ++++-- swtstore/classes/views/sweet.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/swtstore/application.py b/swtstore/application.py index 0d608e0..2ebc0f5 100644 --- a/swtstore/application.py +++ b/swtstore/application.py @@ -156,8 +156,10 @@ def configure_logging(app): '[in %(pathname)s:%(lineno)d]') # Also error can be sent out via email. So we can also have a SMTPHandler? - log_file = app.config['LOG_FILE'] - max_size = 1024 * 1024 * 20 # Max Size for a log file: 20MB + log_file = os.path.join(os.path.dirname(__file__), '..', + app.config['LOG_FILE']) + + max_size = 1024 * 1024 * 20 # Max Size for a log file: 20MB log_handler = RotatingFileHandler(log_file, maxBytes=max_size, backupCount=10) diff --git a/swtstore/classes/views/sweet.py b/swtstore/classes/views/sweet.py index 77c8616..1c8f33d 100644 --- a/swtstore/classes/views/sweet.py +++ b/swtstore/classes/views/sweet.py @@ -10,7 +10,7 @@ from swtstore.classes.models import Context, Sweet, User sweet = Module(__name__) -@sweet.route('/', methods=['GET']) +@sweet.route('/', methods=['GET']) def showSweet(id): #current_user = User.getCurrentUser() #if current_user is None: -- 1.7.10.4