equal
deleted
inserted
replaced
|
1 Installation of Iro |
|
2 =================== |
|
3 |
|
4 Start with downloading the source http://BLAFOO. Install the module via ``setup.py install`` und ran ``iro-install`` afterwards, that will create a sample configuration file named ``iro.conf``. Now update the Configuration file and run ``iro-install install`` afterwards, that will create the Database and Offers for you. After that you have to ref:`adding_user`. After that you can start Iro ``twisted -ny extras/iro.tac``. |
|
5 |
|
6 .. _adding_user: |
|
7 |
|
8 Add User and Userrights |
|
9 ----------------------- |
|
10 |
|
11 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. |
|
12 |
|
13 |
|
14 You can add users and userright via SQL:: |
|
15 |
|
16 INSERT INTO user (name,apikey,ng_kunde) VALUES("test","a1b2c3"); |
|
17 INSERT INTO userrights (user,offer,default) VALUES ("test",OFFERNAME,NULL); |
|
18 |
|
19 or use python/ipython:: |
|
20 |
|
21 >>> import iro.model.schema |
|
22 >>> from iro.model import schema |
|
23 >>> from sqlalchemy import create_engine |
|
24 >>> from iro.model.utils import WithSession |
|
25 >>> engine = create_engine(DBURL) |
|
26 >>> with WithSession(engine) as session: |
|
27 ... u = schema.User(name="test",apikey="a1a2c3") |
|
28 ... session.add(u) |
|
29 ... o = session.query(Offer).filter_by(name=OFFERNAME).first() |
|
30 ... u.rights.append(Userright(o, default=None)) |
|
31 ... session.commit() |
|
32 >>> |
|
33 |
|
34 .. note:: |
|
35 Please make sure that, the apikey only using *hex digest [0-9a-f]* |
|
36 |
|
37 Sample Configuration |
|
38 ==================== |
|
39 |
|
40 .. literalinclude:: ../iro.conf.inst |