Installation instructions¶
Requirements¶
- Django
- https://www.djangoproject.com/
- Translate-toolkit
- http://translate.sourceforge.net/wiki/toolkit/index
- GitPython (>= 0.3)
- https://github.com/gitpython-developers/GitPython
- Django-registration
- https://bitbucket.org/ubernostrum/django-registration/
- Whoosh
- http://bitbucket.org/mchaput/whoosh/
Installation¶
Install all required components (see above) and adjust settings.py
. You
will probably want to adjust following options:
ADMINS
List of site administrators to receive notifications when something goes wrong, for example notifications on failed merge or Django errors.
DATABASE
Connectivity to database server, please check Django’s documentation for more details.
Nota
When using MySQL, don’t forget to create database with UTF-8 encoding:
CREATE DATABASE <dbname> CHARACTER SET utf8;
DEBUG
Disable this for production server.
DEFAULT_FROM_EMAIL
Email sender address for outgoing email, for example registration emails.
SERVER_EMAIL
Email used as sender address for sending emails to administrator, for example notifications on failed merge.
After your configuration is ready, you can run ./manage.py syncdb to create database structure. Now you should be able to create translation projects using admin interface.
You should also login to admin interface (on /admin/
URL) and adjust
default site name to match your domain.
Ver también
Running server¶
Running Weblate is not different from running any other Django based application.
It is recommended to serve static files directly by your webserver, you should use that for following paths:
/media
- Serves
media
directory from Weblate. /static/admin
- Serves media files for Django admin interface (eg.
/usr/share/pyshared/django/contrib/admin/media/
).
Additionally you should setup rewrite rule to serve media/favicon.ico
as favicon.ico
.
Sample configuration for Lighttpd¶
The configuration for Lighttpd web server might look like following (available
as examples/lighttpd.conf
):
fastcgi.server = (
"/weblate.fcgi" => (
"main" => (
"socket" => "/var/run/django/weblate.socket",
"check-local" => "disable",
)
),
)
alias.url = (
"/media" => "/var/lib/django/weblate/weblate/media/",
"/static/admin" => "/usr/share/pyshared/django/contrib/admin/static/admin/",
)
url.rewrite-once = (
"^(/*media.*)$" => "$1",
"^(/*static.*)$" => "$1",
"^/*favicon\.ico$" => "/media/favicon.ico",
"^/*robots\.txt$" => "/media/robots.txt",
"^(/.*)$" => "/weblate.fcgi$1",
)
expire.url = (
"/media/" => "access 1 months",
"/static/" => "access 1 months",
"/favicon.ico" => "access 1 months",
)
Sample configuration for Apache¶
Following configuration runs Weblate as WSGI, you need to have enabled
mod_wsgi (available as examples/apache.conf
):
#
# VirtualHost for weblate
#
WSGIPythonPath /usr/share/weblate
<VirtualHost *:80>
ServerAdmin admin@image.weblate.org
ServerName image.weblate.org
DocumentRoot /usr/share/weblate/weblate/media/
Alias /robots.txt /usr/share/weblate/weblate/media/robots.txt
Alias /favicon.ico /usr/share/weblate/weblate/media/favicon.ico
Alias /media/ /usr/share/weblate/weblate/media/
Alias /doc/ /usr/share/doc/packages/weblate/html/
Alias /static/admin /usr/lib/python2.7/site-packages/django/contrib/admin/static/admin/
<Directory /usr/lib/python2.7/site-packages/django/contrib/admin/static/admin/>
Order deny,allow
Allow from all
</Directory>
<Directory /usr/share/weblate/weblate/media/>
Order deny,allow
Allow from all
</Directory>
<Directory /usr/share/doc/packages/weblate/html/>
Order deny,allow
Allow from all
</Directory>
<Directory /usr/share/weblate/weblate/examples/>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias / /usr/share/weblate/weblate/wsgi.py
WSGIPassAuthorization On
<Directory /usr/share/weblate/weblate>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
</VirtualHost>
Prebuilt appliance¶
Prebuilt appliance provides preconfigured Weblate running with MySQL database as backend and Apache as webserver. However it comes with standard set of passwords you will want to change:
Username | Password | Scope | Description |
---|---|---|---|
root | linux | System | Administrator account, use for local or SSH login |
root | MySQL | MySQL administrator | |
weblate | weblate | MySQL | Account in MySQL database for storing Weblate data |
admin | admin | Weblate | Weblate/Django admin user |
The appliance is built using SUSE Studio and is based on openSUSE 12.1.
Upgrading¶
On upgrade to version 0.6 you should run ./manage.py syncdb and ./manage.py setupgroups --move to setup access control as described in installation section.
On upgrade to version 0.7 you should run ./manage.py syncdb to setup new tables and ./manage.py rebuild_index to build index for fulltext search.
On upgrade to version 0.8 you should run ./manage.py syncdb to setup new tables, ./manage.py setupgroups to update privileges setup and ./manage.py rebuild_index to rebuild index for fulltext search.
On upgrade to version 0.9 file structure has changed. You need to move
repos
and whoosh-index
to weblate
folder. Also running
./manage.py syncdb, ./manage.py setupgroups and
./manage.py setuplang is recommended to get latest updates of
privileges and language definitions.
On upgrade to version 1.0 one field has been added to database, you need to invoke following SQL command to adjust it:
ALTER TABLE `trans_subproject` ADD `template` VARCHAR(200);
Migrating from Pootle¶
As Weblate was originally written as replacement from Pootle, it is supported
to migrate user accounts from Pootle. All you need to do is to copy
auth_user
table from Pootle, user profiles will be automatically created
for users as they log in and they will be asked to update their settings.