Compare commits

..

No commits in common. "2e3c069410d13206dc09aa5266cfdd788c073665" and "1f7f1518ccd5cbe4c31ce0c09009f3367fb7a14a" have entirely different histories.

9 changed files with 11 additions and 44 deletions

View File

6
.gitignore vendored
View File

@ -1,7 +1 @@
**/__pycache__
*.pyc
venv/
env/
.beaker/data/*
!.beaker/data/.noremove
nohup.out

View File

@ -22,26 +22,9 @@ along with this program. If not, see https://www.gnu.org/licenses/.
## Requirement & Installation
### Clone the repository
Clone the repository with `--recursive` when cloning the repo.
git clone https://gitea.ditaajipratama.net/aji/costapy.git --recursive
Note that if you forgot the `--recursive` flag you can do:
git submodule update --init
Note that when submodules have other submodules you need recursive option.
git submodule update --init --recursive
### Dependencies
You need this libraries to use CostaPy:
- bottle
- gunicorn
- beaker
- mako
You can install it with run this command
@ -54,7 +37,6 @@ Here is the completed command
pip install --upgrade pip
pip install bottle
pip install gunicorn
pip install beaker
pip install mako
## Usage

View File

@ -3,6 +3,5 @@ db_main = {
'user' : 'root',
'password' : '',
'database' : 'your_db',
'port' : 3306,
'autocommit' : True,
}

View File

@ -4,14 +4,8 @@ reloader = False
debug = False
server = 'gunicorn' # default = 'wsgiref'
session_opts = {
'session.type': 'file',
'session.cookie_expires': 5*60, # Session expiration in seconds: minutes*seconds
'session.data_dir': './.beaker/data',
'session.auto': True
}
# cors
# session
# error page 403
# error page 404

View File

@ -1,7 +1,9 @@
from bottle import Bottle, static_file
from bottle import Bottle, get, static_file
from config import directory
app = Bottle()
for item in directory.static:
app.route(item['route'], "GET", lambda filepath, root=item['root']: static_file(filepath, root=root) )
for items in directory.static:
@app.get(items['route'])
def static_items(filepath):
return static_file(filepath, root=items['root'])

View File

@ -7,7 +7,6 @@
import sys
from bottle import Bottle, run
from beaker.middleware import SessionMiddleware
import handler
@ -19,8 +18,6 @@ app = Bottle()
app.merge(handler.app)
app.merge(staticdir.app)
app = SessionMiddleware(app, server.session_opts)
run(app,
host = server.host,
port = server.port,

View File

@ -1,6 +1,5 @@
sudo apt-get install -y python3-pip
pip install --upgrade pip
pip install bottle # Micro Framework
pip install gunicorn # WSGI Server Backend
pip install beaker # Session & caching library
pip install mako # Template library
pip install bottle
pip install gunicorn
pip install mako

@ -1 +1 @@
Subproject commit adcbeee71da67d013627b67855ce3351b3a847b7
Subproject commit 9f0f9b85aa0256ad9f021250d16729211464c3a9