doc/book/en/02-install.en.txt
author Sandrine Ribeau <sandrine.ribeau@logilab.fr>
Wed, 19 Nov 2008 17:35:20 -0800
changeset 105 300166b41ea9
parent 74 9a9fe515934d
permissions -rw-r--r--
[doc] Moved installation from mercurial forest in appendix. Cleaned installation section but needs improvements.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
74
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     1
.. -*- coding: utf-8 -*-
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     2
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     3
.. _installation:
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     4
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     5
Installation
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     6
============
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     7
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     8
Download the source
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     9
-------------------
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    10
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    11
- The `Google AppEngine SDK` can be downloaded from:
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    12
  http://code.google.com/appengine/downloads.html
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    13
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    14
- `LAX` is available as an extension of `CubicWeb` under the GPLv2
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    15
  license which can be downloaded from : http://cubicweb.org/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    16
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    17
Please follow instructions on how to install `CubicWeb` framework. 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    18
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    19
Once ``cubicweb-ctl`` is installed, then you can create a Google
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    20
App Engine extension of our framework by running the command ::
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    21
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    22
   cubicweb-ctl newgapp <myapp>
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    23
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    24
This will create a directory containing ::
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    25
 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    26
   `-- myapp/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    27
       |-- app.conf
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    28
       |-- app.yaml
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    29
       |-- bin/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    30
       |    `-- laxctl
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    31
       |-- boostrap_cubes
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    32
       |-- cubes/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    33
       |    |-- addressbook/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    34
       |    ..
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    35
       |    |-- comment
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    36
       |    ..
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    37
       |    `-- zone/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    38
       |-- cubicweb/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    39
       |-- custom.py
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    40
       |-- cw-cubes/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    41
       |-- dateutil/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    42
       |-- docutils/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    43
       |-- fckeditor/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    44
       |-- i18n/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    45
       |-- index.yaml
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    46
       |-- loader.py
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    47
       |-- logilab/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    48
       |-- main.py
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    49
       |-- migration.py
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    50
       |-- mx/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    51
       |-- roman.py
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    52
       |-- rql/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    53
       |-- schema.py
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    54
       |-- simplejson/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    55
       |-- tools/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    56
       |-- views.py
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    57
       |-- vobject/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    58
       |-- yams/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    59
       `-- yapps/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    60
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    61
  
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    62
This skeleton directory is a working `AppEngine` application. You will
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    63
recognize the files ``app.yaml`` and ``main.py``. All the rest is the
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    64
`LAX` framework and its third-party libraries. You will notice that 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    65
the directory ``cubes`` is a library of reusable components.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    66
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    67
The main directories that you should know about are:
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    68
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    69
  - ``cubes`` : this is a library of reusable yams components. To use 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    70
    those components you will list them in the variable 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    71
    `included-yams-cubes` of ``app.conf``. See also :ref:`components`. 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    72
  - [WHICH OTHER ONES SHOULD BE LISTED HERE?]
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    73
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    74
Dependencies
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    75
------------
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    76
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    77
Before starting anything, please make sure the following packages are installed:
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    78
  - yaml : by default google appengine is providing yaml; make sure you can
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    79
    import it. We recommend you create a symbolic link yaml instead of installing 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    80
    and using python-yaml:
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    81
    yaml -> full/path/to/google_appengine/lib/yaml/lib/yaml/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    82
  - gettext
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    83
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    84
Setup
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    85
-----
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    86
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    87
Once you executed ``cubicweb-ctl newgapp <myapp>``, you can use that ``myapp/`` 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    88
as an application directory and do as follows.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    89
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    90
This installation directory provides a configuration for an instance of `CubicWeb`
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    91
ported for Google App Engine. It is installed with its own command ``laxctl`` 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    92
which is a port of the command tool ``cubicweb-ctl`` originally developped for 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    93
`CubicWeb`.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    94
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    95
You can have the details of available commands by running ::
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    96
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    97
   $ python myapp/bin/laxctl --help
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    98
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    99
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   100
Generating translation files
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   101
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   102
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   103
`LAX` is fully internationalized. Translation catalogs are found in
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   104
``myapp/i18n``. To compile the translation files, use the `gettext` tools
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   105
or the ``laxctl`` command ::
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   106
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   107
  $ python myapp/bin/laxctl i18nupdate 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   108
  $ python myapp/bin/laxctl i18ncompile 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   109
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   110
Ignore the errors that print "No translation file found for domain
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   111
'erudi'". They disappear after the first run of i18ncompile.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   112
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   113
.. note:: The command  myapp/bin/laxctl i18nupdate needs to be executed
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   114
   only if your application is using components from ginco-apps.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   115
   Otherwise, please skip it.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   116
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   117
You will never need to add new entries in the translation catalog. Instead we would
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   118
recommand you to use ``self.req._("msgId")`` in your application code
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   119
to flag new message id to add to the catalog, where ``_`` refers to
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   120
xgettext that is used to collect new strings to translate. 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   121
While running ``laxctl i18nupdate``, new string will be added to the catalogs.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   122
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   123
Generating the data directory
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   124
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   125
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   126
In order to generate the ``myapp/data`` directory that holds the static
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   127
files like stylesheets and icons, you need to run the command::
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   128
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   129
  $ python myapp/bin/laxctl populatedata
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   130
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   131
Generating the schema diagram
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   132
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   133
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   134
There is a view named ``schema`` that displays a diagram of the
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   135
entity-relationship graph defined by the schema. This diagram has to
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   136
be generated from the command line::
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   137
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   138
  $ python myapp/bin/laxctl genschema
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   139
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   140
Application configuration
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   141
-------------------------
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   142
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   143
Authentication
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   144
~~~~~~~~~~~~~~
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   145
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   146
You have the option of using or not google authentication for your application.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   147
This has to be define in ``app.conf`` and ``app.yaml``.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   148
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   149
In ``app.conf`` modify the following variable::
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   150
 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   151
  # does this application rely on google authentication service or not.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   152
  use-google-auth=no
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   153
 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   154
In ``app.yaml`` comment the `login: required` set by default in the handler::
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   155
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   156
  - url: .*
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   157
  script: main.py
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   158
  # comment the line below to allow anonymous access or if you don't want to use
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   159
  # google authentication service
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   160
  #login: required
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   161
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   162
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   163
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   164
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   165
Quickstart : launch the application
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   166
-----------------------------------
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   167
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   168
On Mac OS X platforms, drag that directory on the
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   169
`GoogleAppEngineLauncher`.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   170
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   171
On Unix and Windows platforms, run it with the dev_appserver::
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   172
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   173
  $ python /path/to/google_appengine/dev_appserver.py /path/to/myapp/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   174
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   175
Once the local server is started, visit `http://MYAPP_URL/_load <http://localhost:8080/_load>`_ and sign in as administrator. 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   176
This will initialize the repository and enable you to log in into 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   177
the application and continue the installation.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   178
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   179
You should be redirected to a page displaying a message `content initialized`.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   180
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   181
Initialize the datastore
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   182
~~~~~~~~~~~~~~~~~~~~~~~~
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   183
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   184
You, then, want to visit  `http://MYAPP_URL/?vid=authinfo <http://localhost:8080/?vid=authinfo>`_ .
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   185
If you selected not  to use google authentication, you will be prompted to a 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   186
login form where you should initialize the administrator login (recommended
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   187
to use admin/admin at first). You will then be redirected to a page providing
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   188
you the value to provide to ``./bin/laxctl --cookie``.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   189
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   190
If you choosed to use google authentication, then you will not need to set up
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   191
and administrator login but you will get the cookie value as well.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   192
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   193
This cookie values needs to be provided to ``laxctl`` commands
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   194
in order to handle datastore administration requests.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   195
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   196
.. image:: images/lax-book.02-cookie-values.en.png
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   197
   :alt: displaying the detailed view of the cookie values returned
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   198
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   199
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   200
.. note:: In case you are not redirected to a page providing the 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   201
   option --cookie value, please visit one more time  
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   202
   `http://MYAPP_URL/?vid=authinfo <http://localhost:8080/?vid=authinfo>`_ .
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   203
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   204
Once, you have this value, then return to the shell and execute ::
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   205
 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   206
  $ python myapp/bin/laxctl db-init --cookie='dev_appserver_login=test@example.com:True; __session=7bbe973a6705bc5773a640f8cf4326cc' localhost:8080
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   207
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   208
.. note:: In the case you are not using google authentication, the value returned
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   209
   by `http://MYAPP_URL/?vid=authinfo <http://localhost:8080/?vid=authinfo>`_ 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   210
   will look like :
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   211
   --cookie='__session=2b45d1a9c36c03d2a30cedb04bc37b6d'
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   212
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   213
Log out by clicking in the menu at the top right corner
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   214
and restart browsing from `http://MYAPP_URL/ <http://localhost:8080>`_ 
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   215
as a normal user.
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   216
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   217
Unless you did something to change it, http://MYAPP_URL should be
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   218
http://localhost:8080/
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   219
9a9fe515934d [doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   220