Giter Club home page Giter Club logo

bench's Introduction

a web framework with "batteries included"

it's pronounced - fra-pay

Full-stack web application framework that uses Python and MariaDB on the server side and a tightly integrated client side library. Built for ERPNext.

Login for the PWD site: (username: Administrator, password: admin)

Table of Contents

Installation

Production

Development

Contributing

  1. Code of Conduct
  2. Contribution Guidelines
  3. Security Policy

Resources

  1. frappeframework.com - Official documentation of the Frappe Framework.
  2. frappe.school - Pick from the various courses by the maintainers or from the community.
  3. buildwithhussain.dev - Watch Frappe Framework being used in the wild to build world-class web apps.

License

This repository has been released under the MIT License.

By contributing to Frappe, you agree that your contributions will be licensed under its MIT License.

bench's People

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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bench's Issues

Installer Error

Hello, running the command bench get-app erpnext https://github.com/frappe/erpnext gives me the following error

Cloning into 'erpnext'...
remote: Counting objects: 1713, done.
remote: Compressing objects: 100% (1408/1408), done.
Receiving objects: 100% (1713/1713), 2.91 MiB | 300.00 KiB/s, done.
remote: Total 1713 (delta 457), reused 642 (delta 203)
Resolving deltas: 100% (457/457), done.
Checking connectivity... done.
Obtaining file:///home/erpnext/frappe-bench/apps/erpnext
Running setup.py (path:/home/erpnext/frappe-bench/apps/erpnext/setup.py) egg_info for package from file:///home/erpnext/frappe-bench/apps/erpnext

warning: no files found matching '*.json'
warning: no previously-included files matching '*.pyc' found under directory '*'

Downloading/unpacking frappe==4.1.0 (from erpnext==4.1.0)
Could not find any downloads that satisfy the requirement frappe==4.1.0 (from erpnext==4.1.0)
Cleaning up...
No distributions at all found for frappe==4.1.0 (from erpnext==4.1.0)
Storing debug log for failure in /home/erpnext/.pip/pip.log
Error: None
Traceback (most recent call last):
File "/usr/local/bin/bench", line 9, in
load_entry_point('bench==0.1', 'console_scripts', 'bench')()
File "/home/erpnext/bench-repo/bench/cli.py", line 26, in cli
return bench()
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 488, in call
return self.main(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 474, in main
self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 758, in invoke
return self.invoke_subcommand(ctx, cmd, cmd_name, ctx.args[1:])
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 767, in invoke_subcommand
return cmd.invoke(cmd_ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 659, in invoke
ctx.invoke(self.callback, *_ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 325, in invoke
return callback(_args, **kwargs)
File "/home/erpnext/bench-repo/bench/cli.py", line 58, in get_app
_get_app(name, git_url)
File "/home/erpnext/bench-repo/bench/app.py", line 28, in get_app
install_app(app, bench=bench)
File "/home/erpnext/bench-repo/bench/app.py", line 38, in install_app
exec_cmd("{pip} install -e {app}".format(pip=os.path.join(bench, 'env', 'bin', 'pip'), app=os.path.join(bench, 'apps', app)))
File "/home/erpnext/bench-repo/bench/utils.py", line 56, in exec_cmd
subprocess.check_call(cmd, cwd=cwd, shell=True)
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command './env/bin/pip install -e ./apps/erpnext' returned non-zero exit status 1

And here is the pip.log file on Pastebin http://pastebin.com/vL7e479g

bench start

Use foreman/forego/honcho to start the required process for local development

Fix 3to4 migration script

-from .utils import exec_cmd, get_sites, get_frappe
 import frappe
 import argparse
 import os
 import imp
 import json
 import shutil
+import subprocess
+
+def get_sites(bench='.'):
+       sites_dir = os.path.join(bench, "sites")
+       sites = [site for site in os.listdir(sites_dir) 
+               if os.path.isdir(os.path.join(sites_dir, site)) and site not in ('assets',)]
+       return sites
+
+
+def exec_cmd(cmd, cwd='.'):
+       try:
+               subprocess.check_call(cmd, cwd=cwd, shell=True)
+       except subprocess.CalledProcessError, e:
+               print "Error:", e.output
+               raise
+
+def get_frappe(bench='.'):
+       frappe = os.path.abspath(os.path.join(bench, 'env', 'bin', 'frappe'))
+       if not os.path.exists(frappe):
+               print 'frappe app is not installed. Run the following command to install frappe'
+               print 'bench get-app frappe https://github.com/frappe/frappe.git'
+       return frappe

Add Configuration

Options:

  • restart_supervisor_on_update
  • update_bench_on_update

(incomplete list)

Make easy install script

  • Check if Python2.7 is available
  • Install Prerequisites
    • Add MariaDB Repo
    • Install Packages
  • Create user (frappe) if current user is root
  • Clone bench in home dir
  • Install bench in global Python env
  • Setup bench in ~/frappe-bench
  • Configure auto update and backups

GitPython==0.3.2 not available can use GitPython==0.3.2.RC1

Install script fails on Ubuntu 14.04 and Centos 6.5 error is the same:

Downloading/unpacking GitPython==0.3.2 (from bench==0.1)
Could not find a version that satisfies the requirement GitPython==0.3.2 (from bench==0.1) (from versions: 0.1.7, 0.2.0-beta1, 0.3.0-beta1, 0.3.0-beta2, 0.3.1-beta2, 0.3.2.RC1)
Cleaning up...
No distributions matching the version for GitPython==0.3.2 (from bench==0.1)
Storing debug log for failure in /root/.pip/pip.log

Upstream package is: https://pypi.python.org/pypi/GitPython/0.3.2.RC1

bench

static log in page

when i open http://0.0.0.0:8000/
i see page withe more than one login form
html only i cant' access any thing
just static page

fourmax@fourmax-To-be-filled-by-O-E-M:~/frappe-bench$ bench start
11:38:31 web.1 | started with pid 3605
11:38:31 worker.1 | started with pid 3606
11:38:31 workerbeat.1 | started with pid 3608
11:38:31 web.1 | * Running on http://0.0.0.0:8000/
11:38:31 web.1 | * Restarting with reloader
11:38:31 workerbeat.1 | Stale pidfile exists. Removing it.
11:38:31 workerbeat.1 | [2014-07-17 11:38:31,601: INFO/MainProcess] beat: Starting...
11:38:31 workerbeat.1 | [2014-07-17 11:38:31,647: INFO/MainProcess] Scheduler: Sending due task scheduler (frappe.tasks.enqueue_scheduler_events)
11:38:32 worker.1 | [2014-07-17 11:38:32,619: WARNING/MainProcess] /home/fourmax/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/control.py:36: DuplicateNodenameWarning: Received multiple replies from node name: 'name'.
11:38:32 worker.1 | Please make sure you give each node a unique nodename using the -n option.
11:38:32 worker.1 | pluralize(len(dupes), 'name'), ', '.join(sorted(dupes)),
11:38:32 worker.1 | [2014-07-17 11:38:32,633: WARNING/MainProcess] celery@fourmax-To-be-filled-by-O-E-M ready.
11:38:54 web.1 | 127.0.0.1 - - [17/Jul/2014 11:38:54] "GET / HTTP/1.1" 200 -
11:38:54 web.1 | 127.0.0.1 - - [17/Jul/2014 11:38:54] "GET /assets/frappe/js/lib/jquery/jquery.min.js HTTP/1.1" 404 -
11:38:54 web.1 | 127.0.0.1 - - [17/Jul/2014 11:38:54] "GET /assets/css/frappe-web.css HTTP/1.1" 404 -
11:38:54 web.1 | 127.0.0.1 - - [17/Jul/2014 11:38:54] "GET /assets/js/frappe-web.min.js HTTP/1.1" 404 -
11:38:54 web.1 | 127.0.0.1 - - [17/Jul/2014 11:38:54] "GET /style_settings.css HTTP/1.1" 200 -
11:38:54 web.1 | 127.0.0.1 - - [17/Jul/2014 11:38:54] "GET /website_script.js HTTP/1.1" 200 -

use specific site

after install i was adding 3 sites to the erpnext
and i use bench start to run the server for production

how can i use aspecific site

error in update

fourmax@fourmax-To-be-filled-by-O-E-M:~/frappe-bench$ ./scripts/update.sh
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 2), reused 4 (delta 2)
Unpacking objects: 100% (6/6), done.
From https://github.com/frappe/frappe-bench
135efaa..72f8191 master -> origin/master
Updating 135efaa..72f8191
Fast-forward
Readme.md | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
updating apps/erpnext
remote: Counting objects: 2403, done.
remote: Compressing objects: 100% (1067/1067), done.
remote: Total 2403 (delta 1677), reused 1808 (delta 1317)
Receiving objects: 100% (2403/2403), 2.27 MiB | 56.00 KiB/s, done.
Resolving deltas: 100% (1677/1677), done.
From https://github.com/frappe/erpnext

  • branch HEAD -> FETCH_HEAD
    First, rewinding head to replay your work on top of it...
    Fast-forwarded develop to b748115609bd07f52aea82afaed40cff07889ca9.
    /home/fourmax/frappe-bench
    updating apps/frappe
    remote: Counting objects: 2258, done.
    remote: Compressing objects: 100% (1013/1013), done.
    remote: Total 2258 (delta 1517), reused 1728 (delta 1230)
    Receiving objects: 100% (2258/2258), 2.00 MiB | 52.00 KiB/s, done.
    Resolving deltas: 100% (1517/1517), done.
    From https://github.com/frappe/frappe
  • branch HEAD -> FETCH_HEAD
    First, rewinding head to replay your work on top of it...
    Fast-forwarded develop to 0fcfad56ebfb82a352878743d1cf3ba0765dff89.
    /home/fourmax/frappe-bench
    updating apps/shopping_cart
    remote: Counting objects: 53, done.
    remote: Compressing objects: 100% (52/52), done.
    remote: Total 53 (delta 12), reused 16 (delta 1)
    Unpacking objects: 100% (53/53), done.
    From https://github.com/frappe/shopping-cart
  • branch HEAD -> FETCH_HEAD
    First, rewinding head to replay your work on top of it...
    Fast-forwarded develop to c39b630dd0237295f43c50c60e21a659db8ff8aa.
    /home/fourmax/frappe-bench
    Traceback (most recent call last):
    File "/home/fourmax/frappe-bench/env/bin/frappe", line 9, in
    load_entry_point('frappe==4.1.0', 'console_scripts', 'frappe')()
    File "/home/fourmax/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources.py", line 353, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
    File "/home/fourmax/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources.py", line 2302, in load_entry_point
    return ep.load()
    File "/home/fourmax/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources.py", line 2029, in load
    entry = import(self.module_name, globals(),globals(), ['name'])
    File "/home/fourmax/frappe-bench/apps/frappe/frappe/init.py", line 15, in
    from .utils.jinja import get_jenv, get_template, render_template
    File "/home/fourmax/frappe-bench/apps/frappe/frappe/utils/init.py", line 12, in
    from frappe.utils.data import *
    File "/home/fourmax/frappe-bench/apps/frappe/frappe/utils/data.py", line 10, in
    import babel.dates
    ImportError: No module named babel.dates
    fourmax@fourmax-To-be-filled-by-O-E-M:~/frappe-bench$ ./scripts/update.sh
    Already up-to-date.
    updating apps/erpnext
    From https://github.com/frappe/erpnext
  • branch HEAD -> FETCH_HEAD
    Current branch develop is up to date.
    /home/fourmax/frappe-bench
    updating apps/frappe
    From https://github.com/frappe/frappe
  • branch HEAD -> FETCH_HEAD
    Current branch develop is up to date.
    /home/fourmax/frappe-bench
    updating apps/shopping_cart
    From https://github.com/frappe/shopping-cart
  • branch HEAD -> FETCH_HEAD
    Current branch develop is up to date.
    /home/fourmax/frappe-bench
    Traceback (most recent call last):
    File "/home/fourmax/frappe-bench/env/bin/frappe", line 9, in
    load_entry_point('frappe==4.1.0', 'console_scripts', 'frappe')()
    File "/home/fourmax/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources.py", line 353, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
    File "/home/fourmax/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources.py", line 2302, in load_entry_point
    return ep.load()
    File "/home/fourmax/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources.py", line 2029, in load
    entry = import(self.module_name, globals(),globals(), ['name'])
    File "/home/fourmax/frappe-bench/apps/frappe/frappe/init.py", line 15, in
    from .utils.jinja import get_jenv, get_template, render_template
    File "/home/fourmax/frappe-bench/apps/frappe/frappe/utils/init.py", line 12, in
    from frappe.utils.data import *
    File "/home/fourmax/frappe-bench/apps/frappe/frappe/utils/data.py", line 10, in
    import babel.dates
    ImportError: No module named babel.dates

push-app?

Should we have a helper command, bench push-app frappe to push to "origin" if configured?

Make site available on another port (nginx)

bench set-nginx-port sitename port
bench set-default-site sitename
bench config no_default_site on|off

tasks:
- [ ] allow kwargs to be passed to generate_config

Should add another server block for the site in the nginx config

error bench start

command bench start cause error:

Traceback (most recent call last):
File "/usr/local/bin/bench", line 9, in
load_entry_point('bench==0.1', 'console_scripts', 'bench')()
File "/home/fourmax/bench/bench/cli.py", line 24, in cli
return bench()
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 488, in call
return self.main(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 474, in main
self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 758, in invoke
return self.invoke_subcommand(ctx, cmd, cmd_name, ctx.args[1:])
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 767, in invoke_subcommand
return cmd.invoke(cmd_ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 659, in invoke
ctx.invoke(self.callback, *_ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 325, in invoke
return callback(_args, **kwargs)
File "/home/fourmax/bench/bench/cli.py", line 97, in start
_start()
File "/home/fourmax/bench/bench/utils.py", line 157, in start
raise Exception("No process manager found")
Exception: No process manager found

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.