costapy/README.md

89 lines
2.1 KiB
Markdown
Raw Normal View History

2022-03-16 11:06:52 +07:00
# CostaPy
2024-05-12 03:01:35 +07:00
Python Web Framework. Build with Bottle and Mako.
2022-03-16 11:06:52 +07:00
2022-03-16 11:22:14 +07:00
## License
CostaPy
Copyright (C) 2022 Dita Aji Pratama
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see https://www.gnu.org/licenses/.
2022-03-16 11:06:52 +07:00
## Requirement & Installation
2024-06-13 13:01:17 +07:00
### 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
2022-03-16 11:06:52 +07:00
You need this libraries to use CostaPy:
2024-05-12 02:28:57 +07:00
- bottle
- gunicorn
2024-06-13 12:47:26 +07:00
- beaker
2022-03-16 11:06:52 +07:00
- mako
You can install it with run this command
sh install.sh
2022-06-14 14:50:07 +07:00
Here is the completed command
sudo apt-get install -y python3-pip
2022-06-14 14:50:07 +07:00
pip install --upgrade pip
2024-05-12 02:28:57 +07:00
pip install bottle
pip install gunicorn
2024-06-13 12:47:26 +07:00
pip install beaker
2022-06-14 14:50:07 +07:00
pip install mako
2022-03-16 11:06:52 +07:00
## Usage
Use this command to start the web service
2024-05-12 02:28:57 +07:00
python3 costa.py
2022-03-16 11:06:52 +07:00
You can use nohup too and running it in the background like this
2024-05-12 02:28:57 +07:00
nohup python3 costa.py &
2022-03-16 11:06:52 +07:00
## Configuration
### Global Variable (config/globalvar.py)
2024-05-12 02:28:57 +07:00
`globalvar.py` is the place for storing your Global Variable.
2022-03-16 11:06:52 +07:00
2024-05-12 02:28:57 +07:00
`baseurl` </br>
2022-03-16 11:12:43 +07:00
Is the variable for your base URL (without `/` in the end).
2022-03-16 11:06:52 +07:00
2024-05-12 02:28:57 +07:00
`title` </br>
2022-03-16 11:12:43 +07:00
Is the variable for your web title.
2022-03-16 11:06:52 +07:00
### Directory (config/directory.py)
2024-05-12 02:28:57 +07:00
`directory.py` is the place for storing your path. It is useful to calling the path more efficiently.
2022-03-16 11:06:52 +07:00
## Handling the modules
Handling the module is in `handler.py`.