Giter Club home page Giter Club logo

bentodev's Introduction

BentoDev - BentoBox Local Theme Editor

  • Edit BentoBox themes locally
  • Uses real data when making themes
  • Use Flask to act as a proxy between server requests
  • Uses Jinja2 to rigidly enforce template edits

NOTE: This package is currently only supported on POSIX systems. For those on Windows it is recommended to create a new Vagrant box before installing.

It is recommended to install bentodev on a seperate Python 3 virtual environment.

For use with Pipenv

$ pipenv --three
$ pipenv install bentodev

For use with venv

$ python3 -m venv venv
$ source venv/bin/activate
$ pip install bentodev

BentoDev functions are activated via a command line interface.

$ bentodev
Usage: bentodev [OPTIONS] COMMAND [ARGS]...

BentoDev Used to develop themes locally for BentoBox sites!

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

Commands:
  clone   Clone an account you have access too.
  config  Base configuration
  list    List accounts and themes you have access too.
  start   Begin running the development server

Upon using BentoDev for the first time you will be prompted to use add your BentoBox account.

You may also be asked for a password to get a remote token for your session.

By using the command bentodev list or bentodev start you will see the list of available Accounts and their current associated theme.

If you do not see any Accounts/Themes you need to create an Account that is associated to your User through the BentoBox website.

To work on an Account's theme you must first clone the theme. To do so use:

$ bentodev clone <theme_name>

You may be prompted to connect your GitHub account to BentoBox if you have not done so previously.

The theme will then be cloned to the ~/bentodev/sites/<theme_name> folder, where you can then push edits with standard git commands.

Once a theme has been cloned you can then run a small local server that will handle making requests to BentoBox.

$ bentodev start <account_name>

You should then see the server run, where you can connect at localhost:5000

To use all debugging tools, create new features, or use local data, we can switch which server bentodev gets data from. The --local flag will use the HOST and PORT user configuration to access a local BentoBox Django server. Example below:

$ bentodev start <account_name> --local

To make changes to bentodev please clone the repository, then with a separate virtual environment, install it as a local dependency.

$ git clone [email protected]:getbento/bentodev.git
$ mkdir bentodev-local/ && cd bentodev-local && pipenv --three && pipenv shell
$ pipenv install -e ../path/to/cloned/pipenv

This will clone bentodev, create a new virtualenv, and install the local bentodev to that environment.

Then, changes made will be reflected in the running application when using the newly created virtual environment.

TO DEPLOY THOSE CHANGES to the bentodev PyPi repo, ensure that the dev dependencies from bentodev`s Pipfile are installed to a virtual environment or are on your system. Mainly, `setuptools and twine are required for deployment. Bump the version inside: bentodev/__version__.py.

Assuming deps and PyPi configuration is complete, run the following to update the repository:

$ python setup.py upload

Additional user settings can be added to the user config file at ~/bentodev/config.json. Default settings include:

{
  "BENTO_USER": "<user_name>"
}

Additional settings can be added by hand. These include

{
  "DEV_ROOT": "<dir_pat>", (ie. "/Users/<user>/test_folder/")
  "HOST": "<host_value>", (i.e and default "0.0.0.0")
  "PORT": "<port_value>", (i.e and default "8000")
}

Please use the following support channels:

The entire utility is completely coupled to the BentoBox Django Application.

It pulls data from the production (or a local) BentoBox instance and allows real data to displayed as engineers/designers edit themes that are displayed on the getbento.com domain.

bentodev's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

bentodev's Issues

A feature to override the webserver address

Now, the web server url that's generated by the bentodev is http://[HOST]:[POST]. The HOST and the PORT variables are coming from config.json.
When the binding ip is 0.0.0.0, all asset urls are something like http://0.0.0.0:5000/assets/js/main.js, which does not seem to work on windows machine.
So, it would be good for me if there is an option to override the http://[HOST]:[POST].

LOCAL_URL = 'http://{}:{}/'.format(LOCAL_HOST, LOCAL_PORT)

Create option to override localhost:5000

Thank you for creating the DEV_ROOT option.

Now, I hope to it would be possible to override the ip (now it's localhost - hardcoded).
Is it maybe possible to specify some alternative IP addresses?

Version Flag Breaking

The setup.py file which is used to determine the version is not being bundled with the build to display the version of the tool.

Upgrading Requests Past 2.13.0

Attempting to upgrade requests to 2.18.4 and found that Session Auth Headers were breaking. Please find time to discover and fix this issue.

Can not install bentodev

I am not sure that I am asking a stupid question. Why am I not able to run "pip install bentodev"?

image

Pagination

Is there a way to make the pagination url work? Something like http://localhost:5000/blog/?p=3

Templates are cached

Need to restart the server before it sees an update to the underlying templates.

slugify filter

{{ 'index.html' | slugify }}

The bentodev returns index-html, but the live is indexhtml. Which is correct?

Is there a way to change the projects root directory?

It seems the project directories were hardcoded as "~/bentodev" and "~/bentodev/sites".

Now, I would like to have a different "sites" directory.
So if there is an option in the bentodev/config.json file for the sites directory, it would be great!

"SITES_ROOT": "blah/blah/sites" // "sites" as default!

Thank you!

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.