Skip to content

Instantly share code, notes, and snippets.

@lahdo
Forked from dmugtasimov/INSTALL.rst
Created November 17, 2016 14:44
Show Gist options
  • Save lahdo/90b3d841189a55cccd8c97c1e23d8dbc to your computer and use it in GitHub Desktop.
Save lahdo/90b3d841189a55cccd8c97c1e23d8dbc to your computer and use it in GitHub Desktop.
Tryton installation instruction

This installation instrucion describes how to install Tryton Server and Client from scratch for development purposes.

  1. Create virtualenv with virtualenvwrapper:

    mkvirtualenv -p /usr/bin/python2.7 trytond
    
  2. Install Tryton Server:

    pip install trytond==4.0.4
    
  3. Install optional dependencies:

    pip install psycopg2==2.6.2
    
  4. Create PostgreSQL database:

    sudo -u postgres psql << EOF
    CREATE USER tryton WITH SUPERUSER UNENCRYPTED PASSWORD 'tryton';
    CREATE DATABASE tryton OWNER tryton TEMPLATE=template0 ENCODING='utf-8' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8';
    EOF
    
  5. Create configurationo file for Tryton Server:

    cat << EOF > ./tryton.conf
    [web]
    listen=127.0.0.1:8000
    
    [database]
    # uri = database://username:password@host:port/
    uri=postgresql://tryton:[email protected]:5432/tryton
    
    [jsonrpc]
    # Settings for the JSON-RPC network interface
    listen=127.0.0.1:8000
    data=/tryton/sao
    EOF
    
  6. Initialize database and update all installed modules:

    # TODO(dmu) LOW: Why should I have `-d tryton` option although database name is already configured in ./tryton.conf ?
    trytond-admin -c ./tryton.conf -v -d tryton --all
    # Type admin password when prompted
    # TODO(dmu) LOW: Use TRYTONPASSFILE to avoid typing password?
    
  7. Run server in development mode:

    trytond -c ./tryton.conf -v -d tryton --dev
    
  8. Create virtualenv with virtualenvwrapper:

    mkvirtualenv -p /usr/bin/python2.7 tryton-client
    
  9. Install Tryton Client:

    pip install tryton==4.0.4
    
  10. Fix pygtk installation for virtualenv:

    pushd $(dirname `which python`)/../lib/python2.7/site-packages
    ln -s /usr/lib/python2.7/dist-packages/pygtk.py
    ln -s /usr/lib/python2.7/dist-packages/pygtk.pth
    ln -s /usr/lib/python2.7/dist-packages/gtk-2.0/
    ln -s /usr/lib/python2.7/dist-packages/gobject/
    ln -s /usr/lib/python2.7/dist-packages/glib/
    ln -s /usr/lib/python2.7/dist-packages/cairo/
    popd
    
  11. Run Tryton Client:

    tryton
    # Host: 127.0.0.1:8000
    # Database: tryton
    # User name: admin
    # Password: admin
    
  12. [Optional] Install simple module for testing installation:

    workon trytond
    pip install trytond_party
    trytond-admin -c ./tryton.conf -v -d tryton --all
    # Restart Tryton Server:
    trytond -c ./tryton.conf -v -d tryton --dev
    # Restart Tryton Client
    tryton
    # 1. In Tryton Client open by double click: Administration -> Modules -> Modules
    # 2. Click at "Mark for installation" for "party" module
    # 3. In tool bar click "Launch action" -> "Perform Pending Installation/Upgrade"
    # 4. Click "Start Upgrade"
    # 5. Wait until upgrad finishes and click "OK"
    # 6. Cancel all wizards
    # 7. Find "Part" item in the left bar above "Administration" item
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment