diff --git a/config/globalvar.py b/config/globalvar.py index 81da8ab..45deed2 100644 --- a/config/globalvar.py +++ b/config/globalvar.py @@ -1,28 +1,3 @@ title = "CostaPy" -menu = { - "public": { - "navbar": [ - { - "name":"Home", - "target":"_self", - "href":"/", - "roles":["guest"] - }, - { - "name":"About", - "target":"_self", - "href":"/about", - "roles":["guest"] - }, - { - "name":"Docs", - "target":"_blank", - "href":"https://costapy.ditaajipratama.net", - "roles":["guest"] - } - ] - } -} - copyright = "Copyright (C) 2022 Dita Aji Pratama" diff --git a/config/navigation.py b/config/navigation.py new file mode 100644 index 0000000..c4ba852 --- /dev/null +++ b/config/navigation.py @@ -0,0 +1,24 @@ +menu = { + "public": { + "navbar": [ + { + "name":"Home", + "target":"_self", + "href":"/", + "roles":["guest"] + }, + { + "name":"About", + "target":"_self", + "href":"/about", + "roles":["guest"] + }, + { + "name":"Docs", + "target":"_blank", + "href":"https://costapy.ditaajipratama.net", + "roles":["guest"] + } + ] + } +} diff --git a/config/placeholder.py b/config/placeholder.py new file mode 100644 index 0000000..b5017e2 --- /dev/null +++ b/config/placeholder.py @@ -0,0 +1,4 @@ +image = { + "favicon" : "https://ditaajipratama.net/img/no-profile-donut.png", + "profile" : "https://ditaajipratama.net/img/no-profile-donut.png" +} diff --git a/config/server.py b/config/server.py index 8c191b8..1d959ee 100644 --- a/config/server.py +++ b/config/server.py @@ -2,16 +2,16 @@ from bottle import response host = "localhost" port = 11000 -reloader = False +reloader = True debug = False -server = 'gunicorn' # default = 'wsgiref' +server = 'wsgiref' # try 'gunicorn' session_opts = { 'session.type': 'file', 'session.cookie_expires': 5*60, # Session expiration in seconds: minutes*seconds 'session.data_dir': './.beaker/data', 'session.auto': True -} +} # beaker's session options def enable_cors(): response.headers['Access-Control-Allow-Origin' ] = '*' diff --git a/install.sh b/install.sh deleted file mode 100644 index a8b19a5..0000000 --- a/install.sh +++ /dev/null @@ -1,12 +0,0 @@ -python3 -m venv .venv # Create .venv - -.venv/bin/pip3 install --upgrade pip # Upgrade pip - -.venv/bin/pip3 install bottle # Micro Framework -.venv/bin/pip3 install gunicorn # WSGI Server Backend -.venv/bin/pip3 install beaker # Session & caching library -.venv/bin/pip3 install mako # Template library - -.venv/bin/pip3 install mysql-connector # Database connector -.venv/bin/pip3 install bcrypt # Password hash -.venv/bin/pip3 install pyjwt[crypto] # JWT diff --git a/modules/public/home.py b/modules/public/home.py index d9554b2..e137a39 100644 --- a/modules/public/home.py +++ b/modules/public/home.py @@ -1,5 +1,5 @@ from mako.template import Template -from config import globalvar +from config import globalvar, navigation class main: @@ -11,7 +11,7 @@ class main: title = globalvar.title, header = "Welcome to CostaPy", navbar = Template(params["mako"]["website"]['navbar']).render( - menu = globalvar.menu['public']['navbar'], + menu = navigation.menu['public']['navbar'], user_roles = ["guest"], active_page = "Home" ), diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..19df4fa --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +bottle +gunicorn +beaker +mako + +mysql-connector +bcrypt +pyjwt[crypto]