From b19b814bb2545d55562c0455c2f498dcfa7ca410 Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Sun, 18 Jun 2023 15:34:09 +0700 Subject: [PATCH] move erpadir function from server config to directory config --- config/directory.py | 4 ++++ config/server.py | 9 ++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/config/directory.py b/config/directory.py index 2301cda..18a3f70 100644 --- a/config/directory.py +++ b/config/directory.py @@ -1,5 +1,9 @@ import os +# For a static error pages +def erpadir(err): + return f'static/error/{err}.html' + # For templating page = "static/page" template = "static/template" diff --git a/config/server.py b/config/server.py index 4d11f43..0c036b6 100644 --- a/config/server.py +++ b/config/server.py @@ -1,5 +1,4 @@ -def erpadir(err): - return f'static/error/{err}.html' +from config import directory update = { 'server.socket_host' : "hostname" , @@ -8,7 +7,7 @@ update = { 'tools.sessions.on' : True , 'engine.autoreload.on' : False , 'request.show_tracebacks' : False , - 'error_page.403' : erpadir(403) , - 'error_page.404' : erpadir(404) , - 'error_page.500' : erpadir(500) , + 'error_page.403' : directory.erpadir(403) , + 'error_page.404' : directory.erpadir(404) , + 'error_page.500' : directory.erpadir(500) , }