Update REAMDE (#36)

This commit is contained in:
fedjo 2020-06-09 11:33:01 +03:00 committed by GitHub
parent f735329e22
commit 9ad217fc5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 21 deletions

View File

@ -21,13 +21,10 @@ The requirements are:
`dependencies <http://weasyprint.readthedocs.io/en/stable/install.html>`__. `dependencies <http://weasyprint.readthedocs.io/en/stable/install.html>`__.
Install Devicehub with *pip*: Install Devicehub with *pip*:
``pip3 install ereuse-devicehub -U --pre``. ``pip3 install -U -r requirements.txt -e .``.
Running Running
******* *******
Download, or copy the contents, of `this file <examples/app.py>`__, and
call the new file ``app.py``.
Create a PostgreSQL database called *devicehub* by running Create a PostgreSQL database called *devicehub* by running
`create-db <examples/create-db.sh>`__: `create-db <examples/create-db.sh>`__:
@ -40,28 +37,18 @@ Create a PostgreSQL database called *devicehub* by running
- In MacOS: ``bash examples/create-db.sh devicehub dhub``, and password - In MacOS: ``bash examples/create-db.sh devicehub dhub``, and password
``ereuse``. ``ereuse``.
Create the tables in the database by executing in the same directory Using the `dh` tool for set up with one or multiple inventories.
where ``app.py`` is: Create the tables in the database by executing:
.. code:: bash .. code:: bash
$ flask init-db $ export dhi=dbtest; dh inv add --common --name dbtest
Finally, run the app: Finally, run the app:
.. code:: bash .. code:: bash
$ flask run $ export dhi=dbtest;dh run --debugger
The error ``flask: command not found`` can happen when you are not in a
*virtual environment*. Try executing then ``python3 -m flask``.
Execute ``flask`` only to know all the administration options Devicehub
offers.
See the `Flask
quickstart <http://flask.pocoo.org/docs/1.0/quickstart/>`__ for more
info.
The error bdist_wheel can happen when you work with a *virtual environment*. The error bdist_wheel can happen when you work with a *virtual environment*.
To fix it, install in the *virtual environment* wheel To fix it, install in the *virtual environment* wheel
@ -70,9 +57,14 @@ package. ``pip3 install wheel``
Multiple instances Multiple instances
------------------ ------------------
Devicehub can run as a single inventory or with multiple inventories, Devicehub can run as a single inventory or with multiple inventories,
each inventory being an instance of the ``devicehub``. To execute each inventory being an instance of the ``devicehub``. To add a new inventory
one instance, use the ``flask`` command, to execute multiple instances execute:
use the ``dh`` command. The ``dh`` command is like ``flask``, but
.. code:: bash
$ export dhi=dbtest; dh inv add --name dbtest
Note: The ``dh`` command is like ``flask``, but
it allows you to create and delete instances, and interface to them it allows you to create and delete instances, and interface to them
directly. directly.