doc/install.rst
author Sandro Knauß <knauss@netzguerilla.net>
Wed, 25 Apr 2012 15:06:28 +0200
branchdevel
changeset 277 f65edc0382cc
parent 252 d0de2ca7201a
child 290 21601a54c44c
permissions -rw-r--r--
prepare for release: * diffrent web directory with all web specific content (split doc dir -> doc (data) and web (rendered data)) * update installation

Installation of Iro
===================

Start with downloading the `source <../index.html#files>`_.
Afterwards install the module via ``setup.py install`` und ran ``iro-install``. That will create a sample configuration file named ``iro.conf``.
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`. 
Now you are ready to start Iro ``twisted -ny extras/iro.tac``.


.. _adding_user:

Add User and Userrights
-----------------------

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. 

 
You can add users and userright via SQL::

  INSERT INTO user (name,apikey,ng_kunde) VALUES("test","a1b2c3");
  INSERT INTO userrights (user,offer,default) VALUES ("test",OFFERNAME,NULL);

or use python/ipython::

  >>> import iro.model.schema
  >>> from iro.model import schema
  >>> from sqlalchemy import create_engine
  >>> from iro.model.utils import WithSession
  >>> engine = create_engine(DBURL)
  >>> with WithSession(engine) as session:
  ...   u = schema.User(name="test",apikey="a1a2c3")      
  ...   session.add(u)
  ...   o = session.query(Offer).filter_by(name=OFFERNAME).first()
  ...   u.rights.append(Userright(o, default=None))
  ...   session.commit()
  >>>

.. note::
  Please make sure that, the apikey only using *hex digest [0-9a-f]*

Sample Configuration
====================

.. literalinclude:: ../iro.conf.inst