Giter VIP home page Giter VIP logo

bast's Introduction

BAST Framework

https://raw.githubusercontent.com/MOluwole/Bast/master/bast/image/bast.png

travis circleci pversion license coverall status issues contributors downloads

About Bast

Bast is a Simple and Elegant Framework. The main aim of Bast is to create an enjoyable and creative Experience for Developers. Bast attempts to take the pain out of development by making common tasks used in the majority of web projects easy. Bast is aimed to be platform Independent and it's core Language is Python. Uses Python 3.*

Read more in the documentation on ReadTheDocs.

Python Version

Bast makes use of Python 3.0 and above in order to run

Usage

To install Bast, you can download it easily from Pypi using

$ pip install Bast

Bast comes bundled with a very powerful CLI tool called panther. To show the available commands, use

$ panther --help

To create a setup a new project, use

$ panther new project_name
$ cd project_name
$ panther run

To visit the website and see if it's setup successfully, visit 127.0.0.1:2000 in your browser

Update

Bast Routing is now relatively simple and much more easy to use. It embodies the way and manner Laravel defines it's URL's but instead of the @ symbol, Bast makes use of the . You do not need to import your controller again

from bast import Route

route = Route()
route.get('/', 'ExampleController.index')

Bast Controllers are Python Classes which inherit from the Bast Controller Class. Using panther create:controller ControllerName creates a controller file in the controller package. To render template in controller, use self.view('template.html', args=None) where the args is a Dictionary object and optional

from bast import Controller


class TestController(Controller):
    def index(self):
        self.view('index.html')

To run your app use

$ panther run

Maintainer

$  Majiyagbe Oluwole

Contributors

$ Majiyagbe Oluwole
$ Azeez Abiodun Solomon

License

This Framework is Licensed under MIT License

Credits

Bast runs on the Tornado HTTP Server.

For templating, Bast makes use of the Jinja Templating Engine.

Eloquent Object Relation Mapping is achieved using Orator ORM

bast's People

Contributors

elite2code avatar eltneg avatar moluwole avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bast's Issues

Validator

Validation Scheme for the Framework

Can Panther be Python2 compatible?

I completed the installation of Bast on my PC and when I tried to run the command panther --help, I get the error.
screen shot 2018-08-22 at 10 20 52 pm

The secrets module isn't available in Python2 so I guess that's where the error stems from.

Python version: 2.7.14

Error when running Migration

  1. When I execute panther migration:run I get this error: KeyError: DB_TYPE

When I dumped the environment variables using os.environ(), I saw that the values set in .env weren't present.

My solution was to use python-dotenv to load the .env first before trying to access the values.

  1. After resolving the first error, I encountered another error KeyError: 'DB_PREFIX'. I realised it's caused by the DB_PREFIX been empty in the .env file.
    The fix is to set the DB_PREFIX as empty string i.e DB_PREFIX='', but that's not efficient as some env values have to be empty e.g empty db password. The more efficient way is to use os.getenv('KEY', '') instead of os.environ['KEY']

Environment
MacOS 10.15.2
Python 3.7.5
MySQL 8.0.18

Session

create session support for Bast framework

Webpack support

ability to compile scss files to css and also combining multiple JS together

Question: Rest API

Does this package support responding with Json? I can't find anything on it in the documentation and example.

Panther --help throws error due to environment issue on Ubuntu

cabox@box-codeanywhere:~/workspace$  panther --help
Traceback (most recent call last):  File "/usr/local/bin/panther", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 722, in __call__    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 676, in main
    _verify_python3_env()  File "/usr/local/lib/python3.6/dist-packages/click/_unicodefun.py", line 118, in _verify_python3_env
    'for mitigation steps.' + extra)
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment.  Consult http://click.pocoo.org/python3/for mitigation steps.
This system supports the C.UTF-8 locale which is recommended.You might be able to resolve your issue by exporting thefollowing environment variables:
    export LC_ALL=C.UTF-8
    export LANG=C.UTF-8
cabox@box-codeanywhere:~/workspace$ locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

Fix

cabox@box-codeanywhere:~/workspace$ export LC_ALL=C.UTF-8
cabox@box-codeanywhere:~/workspace$ export LANG=C.UTF-8
cabox@box-codeanywhere:~/workspace$ locale
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=C.UTF-8

Now

cabox@box-codeanywhere:~/workspace$  panther --help
Usage: panther [OPTIONS] COMMAND [ARGS]...

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  create:controller   Creates a Controller File
  create:middleware   Creates a Middleware
  create:migration    Create a migration file
  create:model        Create Model File
  create:view         Create a View File
  generate:key        Generate the APP KEY
  migration:reset     Reset Migration
  migration:rollback  Roll Back last Migration
  migration:run       Run Migration
  new                 Create a new Bast Project
  run                 Run your Bast Server

Render

Guys, what do you think of the following:
Instead of self.view() to render view, we use self.render_view() and instead of self.json() to render JSON object, we use self.render_json()?

Panther should be able to initialize a virtual environment in Bast app

I think you should enforce virtualenv as a requirement to use bast
Then after running panther new app
cd app
panther init
this init command should then setup a virtualenv for that project ... so dependencies installed never conflicts

A better way i think is to use pipenv .... This solves the problem by bringing pip and env together
Pipenv Doc

Using pipenv ... the panther init command runs runs pipenv shell to create a virtual env in the app directory instead

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.