Verbatim:Development/Dev Instance: Difference between revisions

 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
Pootle's installation instructions are on the [http://translate.sourceforge.net/wiki/pootle/installation_1.3beta Pootle wiki]. Make sure to follow the (django-based) installation instructions, not the ones referring to jToolkit.
Pootle's installation instructions are on the [http://translate.sourceforge.net/wiki/pootle/installation_1.3beta Pootle wiki]. Make sure to follow the (django-based) installation instructions, not the ones referring to jToolkit.


* have Python 2.4--2.6 installed (Mozilla is currently running 2.4 in production)
* have Python 2.4-2.6 installed (Mozilla is currently running 2.4 in production)
* grab an svn checkout of the Pootle trunk:
* grab an svn checkout of the Pootle trunk:
** <code>svn co https://translate.svn.sourceforge.net/svnroot/translate/src/trunk pootle</code> ... or
** <code>svn co https://translate.svn.sourceforge.net/svnroot/translate/src/trunk pootle</code> ... or
** <code>git svn clone -Ttrunk https://translate.svn.sourceforge.net/svnroot/translate/src/ pootle</code>
** <code>git svn clone -Ttrunk https://translate.svn.sourceforge.net/svnroot/translate/src/ pootle</code>
** if you are using <code>git-svn</code>, make sure to generate an empty <code>dbs</code> directory, as git won't pick up empty directories [http://sourceforge.net/mailarchive/forum.php?thread_name=4A37D896.3070403%40mozilla.com&forum_name=translate-devel]
** if you are using <code>git-svn</code>, make sure to generate an empty <code>dbs</code> directory, as git won't pick up empty directories [http://sourceforge.net/mailarchive/forum.php?thread_name=4A37D896.3070403%40mozilla.com&forum_name=translate-devel]
* create a clean Python environment for the application, using [http://pypi.python.org/pypi/virtualenv virtualenv] (you don't want to install all required libs in your global python directory):
* if you do not want to install Pootle's requirements into your global Python environment, create a clean, virtual Python environment for the application, using [http://pypi.python.org/pypi/virtualenv virtualenv]. Note that this is not required, but may be helpful if you develop on multiple python-based projects
** <code>virtualenv --no-site-packages --python=path/to/python2.[5|6] pootle-env</code>
** <code>virtualenv --no-site-packages --python=path/to/python2.[4-6] pootle-env</code>
** <code>cd pootle-env/</code>
** <code>cd pootle-env/</code>
** <code>. bin/activate</code>
** <code>source bin/activate</code>
* Install the [http://translate.sourceforge.net/wiki/pootle/installation_1.3beta#pre-requisite_software pre-requisites]. Some notes:
* Install the [http://translate.sourceforge.net/wiki/pootle/installation_1.3beta#prerequisite_software prerequisites]. Some notes:
** PyLucene and Xapian are not vital
** PyLucene and Xapian are not vital
** The translate toolkit is part of the Pootle project too, and while it comes with an svn checkout of the trunk you still need to install it:
** The translate toolkit is part of the Pootle project too, and while it comes with an svn checkout of the trunk you still need to install it:
Line 19: Line 19:
*** <code>python setup.py install</code>
*** <code>python setup.py install</code>
* Initialize the database by running the <code>./PootleServer</code> script once.
* Initialize the database by running the <code>./PootleServer</code> script once.
** '''Note for OS X users:''' At this point I got an error that lxml was not installed. Running <code>easy_install lxml</code> didn't work for me, but it might work for you. Instead what I had to do was download the  [http://codespeak.net/lxml/lxml-2.2.1.tgz lxml .tqz] and then:
** '''Note for OS X users:''' At this point you may get an error that lxml is not installed. Running <code>easy_install lxml</code> didn't work for me, but it might work for you. Instead what I had to do was download the  [http://codespeak.net/lxml/index.html#download lxml.tqz] and then:
***<code>tar -xvzf lxml-2.2.1.tgz</code>
***<code>tar -xvzf lxml-2.2.1.tgz</code>
***<code>cd lxml-2.2.1</code>
***<code>cd lxml-2.2.1</code>

Latest revision as of 08:40, 28 July 2009

Verbatim » Development / Dev Instance

Setting up a Pootle development instance

Pootle's installation instructions are on the Pootle wiki. Make sure to follow the (django-based) installation instructions, not the ones referring to jToolkit.

  • have Python 2.4-2.6 installed (Mozilla is currently running 2.4 in production)
  • grab an svn checkout of the Pootle trunk:
  • if you do not want to install Pootle's requirements into your global Python environment, create a clean, virtual Python environment for the application, using virtualenv. Note that this is not required, but may be helpful if you develop on multiple python-based projects
    • virtualenv --no-site-packages --python=path/to/python2.[4-6] pootle-env
    • cd pootle-env/
    • source bin/activate
  • Install the prerequisites. Some notes:
    • PyLucene and Xapian are not vital
    • The translate toolkit is part of the Pootle project too, and while it comes with an svn checkout of the trunk you still need to install it:
      • cd pootle
      • python setup.py install
  • Initialize the database by running the ./PootleServer script once.
    • Note for OS X users: At this point you may get an error that lxml is not installed. Running easy_install lxml didn't work for me, but it might work for you. Instead what I had to do was download the lxml.tqz and then:
      • tar -xvzf lxml-2.2.1.tgz
      • cd lxml-2.2.1
      • python setup.py build --static-deps
      • python setup.py install
    • The issue apparently is that lxml requires newer versions of the libxml and libxslt libraries than the system offers. Building from source with the --static-deps flag will force lxml to download the versions it needs and link against those. More details are available on the lxml website.
  • You can run the pootle server later by using ./manage.py runserver PORTNUMBER (if you omit PORTNUMBER, it'll default to 8000) [2]