|
1 Installation of Iro |
|
2 =================== |
|
3 |
|
4 Start with downloading the `source <../index.html#files>`_. |
|
5 Afterwards install the module via ``setup.py install`` und ran ``iro-install``. That will create a sample configuration file named ``iro.conf``. |
|
6 Update the configuration file and run ``iro-install install`` afterwards. That will create the Database and Offers for you. |
|
7 After that you have to :ref:`adding_user`. |
|
8 Now you are ready to start Iro ``twisted iro``. |
|
9 |
|
10 |
|
11 .. _adding_user: |
|
12 |
|
13 Add User and Userrights |
|
14 ----------------------- |
|
15 |
|
16 You'll need user and right to spefific Offers, that a user can send with a specific Offer. Till now, it is the only way to add/modify user/userrights. |
|
17 |
|
18 |
|
19 You can add users and userright via SQL:: |
|
20 |
|
21 INSERT INTO user (name,apikey,ng_kunde) VALUES("test","a1b2c3"); |
|
22 INSERT INTO userrights (user,offer,default) VALUES ("test",OFFERNAME,NULL); |
|
23 |
|
24 or use python/ipython:: |
|
25 |
|
26 >>> import iro.model.schema |
|
27 >>> from iro.model.schema import * |
|
28 >>> from sqlalchemy import create_engine |
|
29 >>> from iro.model.utils import WithSession |
|
30 >>> engine = create_engine(DBURL) |
|
31 >>> with WithSession(engine) as session: |
|
32 ... u = User(name="test",apikey="a1a2c3") |
|
33 ... session.add(u) |
|
34 ... o = session.query(Offer).filter_by(name=OFFERNAME).first() |
|
35 ... u.rights.append(Userright(o, default=None)) |
|
36 ... session.commit() |
|
37 >>> |
|
38 |
|
39 .. note:: |
|
40 Please make sure that, the apikey only using *hex digest [0-9a-f]* |
|
41 |
|
42 Sample Configuration |
|
43 ==================== |
|
44 |
|
45 .. literalinclude:: ../iro.conf.inst |