All you need

This is the list of all the external dependencies of Genro Framework:

  1. Python 2.5.1 (Language) Required by Genro
  2. Server Apache2 (Webserver) Required by Genro Web
  3. mod_python (Apache/Python Integration) Required by Genro Web
  4. Dojo (Javascript toolkit) Required by Genro Web
  5. PostGreSQL (Database) Required by Genro Db
  6. EasyInstall (useful for Python installation) EXTREMELY USEFUL
  7. psycopg (A PostgreSQL database adapter for Python) Required by Genro Db
  8. simplejson python library for json format
  9. mako a python's template library
  10. Babel . This is installed with sudo easy_install babel
  11. pytz. This is required by babel to better manage time zones
  12. vobject . Used for iCal and address book integration
  13. dateutil
  14. http://www.reportlab.org/downloads.html (PDF Reporting) Required by Genro for PDF Reporting
  15. sudo easy_install -Z xlrd for reading excel files
  16. sudo easy_install -Z xlwt for writing excel files

Required by Genro Db

Python 2.5.1

Apache2

./configure
sudo make
sudo make install

To start Apache2 server

sudo /usr/local/apache2/bin/apachectl start

to restart

sudo /usr/local/apache2/bin/apachectl restart

if console shows # error APR has detected sendfile

#define APR_HAVE_SYS_SENDFILE 0

in srclib/apr/include/apr.h

mod_python

  • mod_python
  • Unpack the downloded file
  • from the installation folder:
  • Follow the README

For OSX you need to su to root. This may mean you need to enable the root user Instructions to enable the root user are found http://www.macosxhints.com/article.php?story=20071025100950309

for osx this write this

./configure --with-apxs=/usr/local/apache2/bin/apxs
make
su
make install

if you don't want to enable root

./configure --with-apxs=/usr/local/apache2/bin/apxs
make
sudo make install

Dojo Toolkit

PostgreSql

OSX user create the user postgres. Then open terminal

./configure
make
su
make install
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

You also need to create a log directory for the logs in order to start postgres successfully

EasyInstall?

  • EasyInstall
  • download ez_setup.py
  • from your console
        python ez_setup.py
    

Psycopg

Before installing Psycopg, make sure you have added to your .profile, the path

PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/pgsql/bin:/usr/local/genro/bin:$path"

export PATH

Then you can execute:

    sudo easy_install psycopg2

Mako

Install easy_install then

easy_install mako

simplejson

if you have installed easy_install

easy_install simplejson

babel

if you have installed easy_install

sudo easy_install babel

pytz

This is required to better manage timezones, and is required when using babel if you have installed easy_install

sudo easy_install pytz

vobject

This is required to integrate iCal and address Book with Genropy if you have installed easy_install

sudo easy_install vobject

dateutil

if you have installed easy_install

sudo easy_install dateutil

Genro

  • downolad
  • use the installation script

Framework installation and GenroHome

When you install GenroPy-framework, a new directory tree is been created at your /usr/local/ path. The path /usr/local/genro is called GenroHome, we suggest to set /usr/local/genro/bin in your profile PATH to use easily the following bin commands.

Here's how GenroHome is structured:

  • bin
  • data: will contain application instances and sites
  • lib: contains jasvascript libraries
  • [packages]: contains some ready packages. You can put yours here.

Check all the components

  • Apache2
  • mod_python
  • sqlite
  • pysqlite
  • Dojo

Rename the Dojo directory as dojo and move it at path /usr/local/genro/lib.

Test demosite

  • Open /usr/local/apache2/conf/httpd.conf
  • Set a port number e.g. 8008
  • Add at the end of file
    
LoadModule python_module /usr/local/apache2/modules/mod_python.so
<Directory /usr/local/apache2/htdocs/gnrsites/demo/pages>
    DirectoryIndex index.py
    AddHandler mod_python .py
    PythonHandler mod_python.publisher
    PythonDebug On
</Directory>

Go to http://localhost:8001/demos/pages