Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
|docs| |python| |pypi| |license|
Baka Framework
_ adalah web application framework yang menggunakan core wsgi dari Pyramid.
Kamu dapat menggunakan baka framework dengan sangat sederhana seperti route handler function
, misalnya.
.. code:: python
from baka import Baka from baka.log import log
app = Baka(name)
@app.route('/') def index_page(req): log.info(req) return {'Baka': 'Hello World!'}
@app.route('/home') def home_page(req): log.info(req) return {'Route': 'home'}
class ResourcesPage(object): def init(self, request): self._name = 'Resource Page' log.info(request.params)
@ResourcesPage.GET() def resources_page_get(root, request): return { 'hello': 'Get Hello resources from Page root %s ' % page._name }
Dengan penggunakan baka.include(callable)
, kamu dapat menggabungkan module terpisah dari beberapa file didalam package module.
contoh file: testbaka/view_user.py
.. code:: python
from .app import app
@app.route('/users') def user(req): return {'users': 'all data'}
def includeme(config): pass
file: testbaka/app.py
.. code:: python
from baka import Baka from baka.log import log
app = Baka(name) app.include('testbaka.view_user') # include module dari file view_user.py
@app.route('/') def index_page(req): log.info(req) return {'Baka': 'Hello World!'}
@app.route('/home') def home_page(req): log.info(req) return {'Route': 'home'}
Untuk Struktur Application Folder optional
.. code:: yaml
root
package (AppBaka)
config optional, Baka(__name__, config_schema=True)
config.yaml # digunakan for baka default configuration
init.py # the code goes in here
wsgi.py # for running in wsgi container e.g gunicorn
run.py # running development server
Default Configuration Baka from config.yaml
.. code-block:: yaml
package: AppBaka # mandatory for root package version: 0.1.0 # optional baka: debug_all: True # mandatory for debug environment meta: version: 0.1.0 # mandatory for json response version
WSGI Container Application Server wsgi.py
.. code:: python
""" WSGI Application Server ~~~~~~~~~ :author: nanang.jobs@gmail.com :copyright: (c) 2017 by Nanang Suryadi. :license: BSD, see LICENSE for more details.
wsgi.py
""" from . import app
application = app
Running in Development mode run.py
.. code:: python
""" :author: nanang.jobs@gmail.com :copyright: (c) 2017 by Nanang Suryadi. :license: BSD, see LICENSE for more details.
run.py.py
""" from . import app
app.run(use_reloader=True)
.. code:: python
pip install baka
Development mode
.. code::
python run.py
Production mode with Gunicorn
.. code::
gunicorn -w 1 -b 0.0.0.0:5000 AppBaka.wsgi
.. code::
git clone https://github.com/baka-framework/baka.git
cd examples
python3 -m venv env
source env/bin/active
pip install baka
python run.py
Qoutes from heroes.
“ Learning without thinking is useless, but thinking without learning is very dangerous! ”
-― Sukarno, Di Bawah Bendera Revolusi : Jilid 1
“ Apabila dalam diri seseorang masih ada rasa malu dan takut untuk berbuat suatu kebaikan, maka jaminan bagi orang tersebut adalah tidak akan bertemunya ia dengan kemajuan selangkah pun ”
-- Sukarno
“ Kurang cerdas dapat diperbaiki dengan belajar, kurang cakap dapat dihilangkan dengan pengalaman. Namun tidak jujur sulit diperbaiki. ”
-- Bung Hatta
“ Keberanian bukan berarti tidak takut, keberanian berarti menaklukan ketakutan. ”
-- Bung Hatta
.. |license| image:: https://img.shields.io/pypi/l/baka.svg :alt: License :target: https://pypi.python.org/pypi/baka/0.4.2
.. |pypi| image:: https://img.shields.io/pypi/v/baka.svg :alt: Pypi package manager :target: https://pypi.python.org/pypi/baka/0.4.2
.. |python| image:: https://img.shields.io/pypi/pyversions/baka.svg :alt: Python version :target: https://pypi.python.org/pypi/baka/0.4.2
.. |docs| image:: https://readthedocs.org/projects/baka-framework/badge/?version=latest :alt: Documentation Status :target: https://baka-framework.readthedocs.io/en/latest/?badge=latest
.. |docs_dev| image:: https://readthedocs.org/projects/baka-framework/badge/?version=develop :alt: Documentation Status :target: https://baka-framework.readthedocs.io/en/latest/?badge=develop
FAQs
Baka framework built top pyramid
We found that baka demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.