# Devicehub
Devicehub is an IT Asset Management System focused in reusing devices,
created under the project [eReuse.org](https://www.ereuse.org).
Our main objectives are:
- To offer a common IT Asset Management for donors, receivers and IT
professionals so they can manage devices and exchange them.
This is, reusing –and ultimately recycling.
- To automatically recollect, analyse, process and share
(controlling privacy) metadata about devices with other tools of the
eReuse ecosystem to guarantee traceability, and to provide inputs for
the indicators which measure circularity.
- To highly integrate with existing IT Asset Management Systems.
- To be decentralized.
Devicehub is built with [Teal](https://github.com/bustawin/teal) and
[Flask](http://flask.pocoo.org).
## Installing
The requirements are:
- Python 3.5.3 or higher. In debian 9 is `# apt install python3-pip`.
- PostgreSQL 9.6 or higher. In debian 9 is `# apt install postgresql`
- passlib. In debian 9 is `# apt install python3-passlib`.
Install Devicehub with *pip*: `pip3 install ereuse-devicehub -U --pre`.
## Running
Create a python file with the following and call it `app.py`:
```python
from ereuse_devicehub.devicehub import Devicehub
from ereuse_devicehub.config import DevicehubConfig
class MyConfig(DevicehubConfig):
ORGANIZATION_NAME = 'My org'
ORGANIZATION_TAX_ID = 'foo-bar'
app = Devicehub(MyConfig())
```
Create a PostgreSQL database called *devicehub*:
```bash
sudo su - postgres # Change to Postgres main user
postgres $ createdb devicehub # Create main database
postgres $ psql devicehub # Access to the database
postgres $ CREATE USER dhub WITH PASSWORD 'ereuse'; # Create user devicehub uses to access db
postgres $ GRANT ALL PRIVILEGES ON DATABASE devicehub TO dhub; # Give access to the db
postgres $ \q
exit
```
Create the tables in the database by executing in the same directory
where `app.py` is:
```bash
$ flask init-db
```
Finally, run the app:
```bash
$ flask run
```
The error `flask: command not found` can happen when you are not in a
*virtual environment*. Try executing then `python3 -m flask`.
See the [Flask quickstart](http://flask.pocoo.org/docs/1.0/quickstart/)
for more info.
## Administrating
Devicehub has many commands that allows you to administrate it. You
can, for example, create a dummy database of devices with ``flask dummy``
or create users with ``flask create-user``. See all the
available commands by just executing ``flask`` and get more information
per command by executing ``flask command --help``.
## Understand the software
See the [docs](docs/index.rst) to understand how the software works and
the design principles.
### Use the API
Checkout [Swagger](https://app.swaggerhub.com/apis/ereuse/devicehub/0.2)
to see the schemas and endpoints (we are working in making it
interactive).
Use postman as an example of how to use the API.
[![Run in Postman](https://run.pstmn.io/button.svg)](https://documenter.getpostman.com/view/254251/RWEnmFPs)
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
ereuse-devicehub-0.2.0a10.tar.gz (63个子文件)
ereuse-devicehub-0.2.0a10
MANIFEST.in 53B
PKG-INFO 4KB
tests
test_organization.py 665B
test_device.py 16KB
test_user.py 3KB
test_event.py 6KB
test_inventory.py 4KB
conftest.py 3KB
test_auth.py 1KB
test_tag.py 4KB
test_basic.py 1KB
__init__.py 0B
test_workbench.py 5KB
test_snapshot.py 15KB
test_rate.py 2KB
test_models.py 0B
eReuse_Devicehub.egg-info
PKG-INFO 4KB
requires.txt 192B
SOURCES.txt 2KB
top_level.txt 23B
dependency_links.txt 1B
setup.cfg 38B
setup.py 1KB
README.md 3KB
ereuse_devicehub
marshmallow.py 531B
auth.py 472B
db.py 86B
resources
models.py 450B
image
models.py 2KB
__init__.py 0B
tag
view.py 2KB
__init__.py 2KB
schema.py 585B
model.py 2KB
enums.py 5KB
user
models.py 2KB
__init__.py 3KB
views.py 904B
schemas.py 1KB
exceptions.py 162B
__init__.py 0B
device
models.py 10KB
__init__.py 2KB
views.py 824B
schemas.py 6KB
sync.py 11KB
exceptions.py 1KB
schemas.py 858B
event
models.py 21KB
__init__.py 3KB
views.py 3KB
schemas.py 10KB
inventory.py 4KB
client.py 4KB
__init__.py 0B
dummy
dummy.py 2KB
__init__.py 0B
files
computer-monitor.snapshot.yaml 344B
real-toshiba.snapshot.11.yaml 3KB
workbench-server-1.snapshot.yaml 3KB
real-hp.snapshot.11.yaml 4KB
devicehub.py 1KB
config.py 3KB
共 63 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功