move erpadir function from server config to directory config

This commit is contained in:
Dita Aji Pratama 2023-06-18 15:34:09 +07:00
parent bee07d0323
commit b19b814bb2
2 changed files with 8 additions and 5 deletions

View File

@ -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"

View File

@ -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) ,
}