Want to try Pootle? This guide will guide you through installing Pootle and its requirements in a virtual environment.
Before proceeding, consider installing these first:
If you only want to have a sneak peek of Pootle, the default configuration and the built-in server will suffice. But in case you want to deploy a real world server, installing optional packages, using a real database and a proper web server is highly recommended.
The easiest way to test and install Pootle is by using pip. However, installations can be done straight from git sources or be automated by using fabric deployment scripts.
Your Pootle installation will need to be flexible enough to handle the translation load. The recommended hardware depends highly on the performance you expect, the number of users you want to support, and the number and size of the files you want to host.
Whatever hardware you have, you will still benefit from performance improvements if you can optimize your system.
Your disk space should always be enough to store your files and your Pootle database, with some extra space available.
In order to install Pootle you will first create a virtual environment. This allows you to keep track of dependencies without messing up with system packages. For that purpose you need to install the virtualenv package. You might already have it, but in case you haven’t:
$ pip install virtualenv
Now create a virtual environment on your location of choice by issuing the virtualenv command:
$ virtualenv /var/www/pootle/env/
This will copy the system’s default Python interpreter into your environment. For activating the virtual environment you must run the activate script:
$ source /var/www/pootle/env/bin/activate
Every time you activate this virtual environment, the Python interpreter will know where to look for libraries. Also notice the environment name will be prepended to the shell prompt.
After creating the virtual environment, you can safely ask pip to grab and install Pootle by running:
(env) $ pip install Pootle
This will fetch and install the minimum set of required dependencies as well.
If you run into trouble while installing the dependencies, it’s likely that you’re missing some extra packages needed to build those third-party packages.
For example, lxml needs a C compiler.
lxml also require the development packages of libxml2 and libxslt.
Older versions of pip may try installing pre-release versions of Pootle, e.g. installing 2.5.1-rc1 instead of 2.5.1. In that case run:
(env) $ pip install Pootle==2.5.1
If everything went well, you will now be able to access the pootle command line tool within your environment.
(env) $ pootle --version Pootle 2.5.1 Translate Toolkit 1.11.0 Django 1.6.5
Once Pootle has been installed, you will need to initialize a configuration file for it. This is as easy as running:
(env) $ pootle init
By default it writes the configuration file at ~/.pootle/pootle.conf but if you want you can pass an alternative path as an argument to the init command. If the desired path exists, you will be prompted for whether to overwrite the old configuration. Passing the --noinput flag assumes a negative answer.
This default configuration is enough to initially experiment with Pootle but it’s highly discouraged and unsupported to use this configuration in a production environment.
Also, the default configuration uses SQLite, which shouldn’t be used for anything more than testing purposes.
The initial configuration includes the settings that you’re most likely to change. For further customization, you can also check for the full list of available settings.
Before your run Pootle for the first time, you need to create the schema for the database and populate it with initial data. This is done by executing the setup management command:
(env) $ pootle setup
By default Pootle provides a built-in CherryPy server that will be enough for quickly testing the software. To run it, just issue:
(env) $ pootle start
And the server will start listening on port 8000. This can be accessed from your web browser at http://localhost:8000/.
By default the Pootle server runs on port 8000 and you will probably be interested on binding it to the usual port 80. Also, it’s highly recommended to have all the static assets served by a proper web server, and setting up a web proxy is the simplest way to go.
The Running under a Web Server section has further information on setting up a web server that proxyes requests to the application server.
If you want to omit a reverse proxy and rather prefer to use a web server for serving both dynamic and static content, you can also setup such a scenario with Apache and mod_wsgi for example.
This has been a quickstart for getting you up and running. If you want to continue diving into Pootle, you should first consider making some optimizations to your setup — don’t forget to switch your database backend! After that you should also adjust the application configuration to better suit your specific needs.
For additional scripting and improved management, Pootle also provides a set of management commands to ease the automation of common administration tasks.