<a id="install"></a>

# Instrucțiuni de configurare

## Instalarea Weblate

În funcție de configurația și experiența dumneavoastră, alegeți o metodă de instalare adecvată pentru dumneavoastră:

* [Instalarea folosind Docker](https://docs.weblate.org/ro/latest/admin/install/docker.md), recomandat pentru configurațiile de producție.
* Instalarea Virtualenv, recomandată pentru configurațiile de producție:
  * [Instalarea pe Debian și Ubuntu](https://docs.weblate.org/ro/latest/admin/install/venv-debian.md)
  * [Instalarea pe SUSE și openSUSE](https://docs.weblate.org/ro/latest/admin/install/venv-suse.md)
  * [Instalarea pe RedHat, Fedora și CentOS](https://docs.weblate.org/ro/latest/admin/install/venv-redhat.md)
  * [Instalarea pe macOS](https://docs.weblate.org/ro/latest/admin/install/venv-macos.md)
* [Instalarea din surse](https://docs.weblate.org/ro/latest/admin/install/source.md), recomandat pentru dezvoltare.
* [Instalarea pe OpenShift](https://docs.weblate.org/ro/latest/admin/install/openshift.md)
* [Instalarea pe Kubernetes](https://docs.weblate.org/ro/latest/admin/install/kubernetes.md)

<a id="architecture"></a>

## Architecture overview

Server web
: Handling incoming HTTP requests, [Servirea fișierelor statice](#static-files).

Celery workers
: [Sarcini de fundal folosind Celery](#celery) are executed here.
  <br/>
  Depending on your workload, you might want to customize the number of workers.
  <br/>
  Use dedicated node when scaling Weblate horizontally.

Application server
: A WSGI or ASGI server serving web pages to users.
  <br/>
  Use dedicated node when scaling Weblate horizontally.

Baza de date
: PostgreSQL database server for storing all the content, see [Configurarea bazei de date pentru Weblate](#database-setup).
  <br/>
  Use dedicated database node for sites with hundreds of millions of hosted words.

Datastore
: Key/value datastore such as Valkey or Redis server for cache and tasks queue, see [Sarcini de fundal folosind Celery](#celery).
  <br/>
  Use dedicated node when scaling Weblate horizontally.

File system
: File system storage for storing VCS repositories and uploaded user data. This is shared by all the processes.
  <br/>
  Use networked storage when scaling Weblate horizontally.

E-mail server
: SMTP server for outgoing e-mail, see [Configurarea e-mailului de ieșire](#out-mail). It can be provided externally.

#### HINT
[Instalarea folosind Docker](https://docs.weblate.org/ro/latest/admin/install/docker.md) includes PostgreSQL and Valkey, making the installation easier.

<a id="requirements"></a>

## Cerințe software

### Sistem de operare

Se știe că Weblate funcționează pe Linux, FreeBSD și macOS. Cel mai probabil vor funcționa și alte sisteme de tip Unix.

Weblate nu este acceptat pe Windows. Dar este posibil să funcționeze în continuare, iar patch-urile sunt acceptate cu plăcere.

#### SEE ALSO
[Architecture overview](#architecture) describes overall Weblate architecture and required services.

<a id="python-deps"></a>

### Dependențe Python

Weblate is written in [Python](https://www.python.org/) and supports Python
3.12 or newer. You can install dependencies using pip or from your
distribution packages, full list is available in `requirements.txt`.

Cele mai notabile dependențe:

Django
: [https://www.djangoproject.com/](https://www.djangoproject.com/)

Țelină
: [https://docs.celeryq.dev/](https://docs.celeryq.dev/)

Translate Toolkit
: [https://toolkit.translatehouse.org/](https://toolkit.translatehouse.org/)

traducător-detector
: [https://github.com/WeblateOrg/translation-finder](https://github.com/WeblateOrg/translation-finder)

Python Social Auth
: [https://python-social-auth.readthedocs.io/](https://python-social-auth.readthedocs.io/)

Cadrul Django REST
: [https://www.django-rest-framework.org/](https://www.django-rest-framework.org/)

<!-- Table is generated using scripts/show-extras.py -->

#### Dependențe opționale

| Optional dependency specifier   | Python packages                                                                                                                                                           | Weblate feature                                                                                                                   |
|---------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| `amazon`                        | [boto3](https://pypi.org/project/boto3/)<br/><br/><br/>[django-ses](https://pypi.org/project/django-ses/)<br/><br/>                                                       | [Amazon Translate](https://docs.weblate.org/ro/latest/admin/machine.md#mt-aws), AWS SES e-mail backend                                    |
| `asgi`                          | [granian](https://pypi.org/project/granian/)<br/><br/>                                                                                                                    | ASGI server for Weblate                                                                                                           |
| `gelf`                          | [logging-gelf](https://pypi.org/project/logging-gelf/)<br/><br/>                                                                                                          | [Graylog log management](#graylog)                                                             |
| `gerrit`                        | [git-review](https://pypi.org/project/git-review/)<br/><br/>                                                                                                              | [Gerrit review requests](https://docs.weblate.org/ro/latest/admin/code-hosting.md#code-hosting-gerrit)                                         |
| `google`                        | [google-cloud-storage](https://pypi.org/project/google-cloud-storage/)<br/><br/><br/>[google-cloud-translate](https://pypi.org/project/google-cloud-translate/)<br/><br/> | [Google Cloud Translation Advanced](https://docs.weblate.org/ro/latest/admin/machine.md#mt-google-translate-api-v3) with glossary support |
| `google-errors`                 | [google-cloud-error-reporting](https://pypi.org/project/google-cloud-error-reporting/)<br/><br/>                                                                          | [Collecting error reports and monitoring performance](#collecting-errors)                                |
| `ldap`                          | [django-auth-ldap](https://pypi.org/project/django-auth-ldap/)<br/><br/>                                                                                                  | [Autentificare LDAP](https://docs.weblate.org/ro/latest/admin/auth.md#ldap-auth)                                                       |
| `mercurial`                     | [mercurial](https://pypi.org/project/mercurial/)<br/><br/>                                                                                                                | [Mercurial](https://docs.weblate.org/ro/latest/vcs.md#vcs-mercurial)                                                            |
| `postgres`                      | [psycopg](https://pypi.org/project/psycopg/)<br/><br/>                                                                                                                    | PostgreSQL, see [Configurarea bazei de date pentru Weblate](#database-setup)                          |
| `rollbar`                       | [rollbar](https://pypi.org/project/rollbar/)<br/><br/>                                                                                                                    | [Collecting error reports and monitoring performance](#collecting-errors)                                |
| `saml`                          | [python3-saml](https://pypi.org/project/python3-saml/)<br/><br/><br/>[xmlsec](https://pypi.org/project/xmlsec/)<br/><br/>                                                 | [Autentificare SAML](https://docs.weblate.org/ro/latest/admin/auth.md#saml-auth)                                                       |
| `saml2idp`                      | [djangosaml2idp2](https://pypi.org/project/djangosaml2idp2/)<br/><br/>                                                                                                    | Integrating SAML 2 IDP into Weblate                                                                                               |
| `sphinx`                        | [Sphinx](https://pypi.org/project/Sphinx/)<br/><br/>                                                                                                                      | Needed for [Update POT file (Sphinx)](https://docs.weblate.org/ro/latest/admin/addons.md#addon-weblate-gettext-sphinx)                   |
| `wllegal`                       | [wllegal](https://pypi.org/project/wllegal/)<br/><br/>                                                                                                                    | Hosted Weblate integration                                                                                                        |
| `wsgi`                          | [granian](https://pypi.org/project/granian/)<br/><br/>                                                                                                                    | WSGI server for Weblate                                                                                                           |
| `zxcvbn`                        | [django-zxcvbn-password-validator](https://pypi.org/project/django-zxcvbn-password-validator/)<br/><br/>                                                                  | [Autentificarea prin parolă](https://docs.weblate.org/ro/latest/admin/auth.md#password-authentication)                                 |

Atunci când instalați folosind pip, puteți specifica direct caracteristicile dorite la instalare:

```sh
uv pip install "weblate[Postgres,Amazon,SAML]"
```

Sau puteți instala Weblate cu toate funcțiile opționale:

```sh
uv pip install "weblate[all]"
```

Sau puteți instala Weblate fără nicio funcție opțională:

```sh
uv pip install weblate
```

<a id="troubleshoot-pip-install"></a>

### Troubleshooting pip install

`ffi_prep_closure(): bad user_data (it seems that the version of the libffi library seen at runtime is different from the 'ffi.h' file seen at compile-time)`
: Acest lucru este cauzat de incompatibilitatea pachetelor binare distribuite prin PyPI cu distribuția. Pentru a rezolva acest lucru, trebuie să reconstruiți pachetul pe sistemul dumneavoastră:
  <br/>
  ```sh
  uv pip install --force-reinstall --no-binary :all: cffi
  ```

`error: ‘xmlSecKeyDataFormatEngine’ undeclared (first use in this function); did you mean ‘xmlSecKeyDataFormat’?`
: This is a known issue of the xmlsec package, please see [https://github.com/xmlsec/python-xmlsec/issues/314](https://github.com/xmlsec/python-xmlsec/issues/314).

`lxml & xmlsec libxml2 library version mismatch`
: The `lxml` and `xmlsec` packages have to be built against one `libxml2`. You should build them locally to avoid this issue:
  <br/>
  ```sh
  uv pip install --force-reinstall --no-binary xmlsec --no-binary lxml lxml xmlsec
  ```

### Alte cerințe de sistem

Următoarele dependențe trebuie să fie instalate pe sistem:

`Git`
: [https://git-scm.com/](https://git-scm.com/)

`git-review` (opțional pentru suport Gerrit)
: [git-review](https://pypi.org/project/git-review/)

`git-svn` (opțional pentru suport pentru Subversion)
: [https://git-scm.com/docs/git-svn](https://git-scm.com/docs/git-svn)

`tesseract` (needed only if **tesserocr** binary wheels are not available for your system)
: [https://github.com/tesseract-ocr/tesseract](https://github.com/tesseract-ocr/tesseract)

### Dependențe în timp de construcție

Pentru a construi unele dintre [Dependențe Python](#python-deps), ar putea fi necesar să instalați dependențele acestora. Acest lucru depinde de modul în care le instalați, așa că vă rugăm să consultați pachetele individuale pentru documentație. Nu veți avea nevoie de acestea dacă folosiți `Wheels` preinstalate în timp ce instalați folosind `pip` sau când folosiți pachete de distribuție.

<a id="hardware"></a>

## Cerințe hardware

Weblate should run on any contemporary hardware without problems, the following is
the minimal configuration required to run Weblate on a single host (Weblate, database
and web server):

* 3 GB of RAM
* 2 nuclee CPU
* 1 GB de spațiu de stocare

#### NOTE
Cerințele reale pentru instalarea Weblate variază foarte mult în funcție de dimensiunea traducerilor gestionate în cadrul acesteia.

### Memory usage

The more memory the better - it is used for caching on all
levels (file system, database and Weblate).
For hundreds of translation components, at least 4 GB of RAM is
recommended.

#### HINT
For systems with less memory than recommended, [Single-process Celery setup](#minimal-celery) is recommended.

### CPU usage

Many concurrent users increase the amount of needed CPU cores.

Weblate 2026.8 introduced NumPy as a required dependency. On x86-64 systems,
the optimized NumPy build bundled in the Docker image requires an x86-64-v2
compatible CPU. Without the required CPU features, NumPy fails to load and
Weblate cannot start.

Before upgrading, check for the required SSE4.2 CPU feature on the Linux system
running Docker:

```sh
grep sse4_2 /proc/cpuinfo
```

Empty output indicates that a required CPU feature is unavailable. This is a
preliminary check; finding SSE4.2 does not verify all x86-64-v2 CPU features.

If Docker runs in a virtual machine, run the check inside the guest. Virtual
machines can hide CPU features supported by the host. Configure the virtual
machine to expose the required host CPU features, then reboot the guest. If
the physical CPU lacks the required features, upgrade the hardware.

### Storage usage

The typical database storage usage is around 300 MB per 1 million hosted words.

Storage space needed for cloned repositories varies, but Weblate tries to keep
their size minimal by doing shallow clones.

### Storage performance

Version control operations perform many filesystem metadata lookups. The
`vcs` subdirectory in [`DATA_DIR`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-DATA_DIR) therefore needs low read
latency; storage with slow metadata access can make operations such as
**git status** take a long time even when its bulk throughput is good.
Keep [`CACHE_DIR`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-CACHE_DIR) on low-latency local or temporary storage when
possible.

The deployment checks measure metadata lookup latency for both locations and
warn when the median latency exceeds 10 milliseconds. This is an approximate
point-in-time measurement affected by filesystem and system load. Rerun
**weblate check --deploy** before changing the storage configuration.

### Nodes

For small and medium-sized sites (millions of hosted words), all Weblate components (see
[Architecture overview](#architecture)) can be run on a single node.

When you grow to hundreds of millions of hosted words, it is recommended to
have a dedicated node for database (see [Configurarea bazei de date pentru Weblate](#database-setup)).

## Verifying release artifacts

Release archives can be verified using the signatures, attestations, and SBOMs
published with GitHub release assets. See [Verifying release artifacts](https://docs.weblate.org/ro/latest/security/release-artifacts.md#verify).

<a id="file-permissions"></a>

## Permisiunile sistemului de fișiere

Procesul Weblate trebuie să fie capabil să citească și să scrie în directorul în care păstrează datele - [`DATA_DIR`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-DATA_DIR). Toate fișierele din acest director trebuie să fie deținute și scriere de către utilizatorul care rulează toate procesele Weblate (de obicei WSGI și Celery, a se vedea [Rularea serverului](#server) și [Sarcini de fundal folosind Celery](#celery)).

Configurația implicită le plasează în același arbore ca și sursele Weblate, însă ați putea prefera să le mutați într-o locație mai bună, cum ar fi: `/var/lib/weblate`.

Weblate încearcă să creeze aceste directoare în mod automat, dar nu va reuși dacă nu are permisiuni pentru a face acest lucru.

The configured [`CACHE_DIR`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-CACHE_DIR) also has to be writable by the Weblate
process and has to allow executing generated helper files. Do not mount
[`CACHE_DIR`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-CACHE_DIR) with the `noexec` option.

De asemenea, trebuie să aveți grijă când rulați [Comenzi de gestionare](https://docs.weblate.org/ro/latest/admin/management.md#manage), deoarece acestea ar trebui să fie rulate sub același utilizator cu cel care rulează Weblate însuși, altfel permisiunile pentru unele fișiere ar putea fi greșite.

În containerul Docker, toate fișierele din volumul `/app/data` trebuie să fie deținute de utilizatorul `weblate` din container (UID 1000).

#### SEE ALSO
[Servirea fișierelor statice](#static-files)

<a id="database-setup"></a>

## Configurarea bazei de date pentru Weblate

Se recomandă ca Weblate să ruleze cu un server de baze de date PostgreSQL.

PostgreSQL 13 and higher is supported. PostgreSQL 15 or newer is recommended.

#### SEE ALSO
* [Utilizați un motor de baze de date puternic](#production-database)
* [Databases](https://docs.djangoproject.com/en/stable/ref/databases/)
* [Migrarea de la alte baze de date la PostgreSQL](https://docs.weblate.org/ro/latest/admin/upgrade.md#database-migration)

<a id="db-connections"></a>

### Database connections

In the default configuration, each Weblate process keeps a persistent
connection to the database. Persistent connections improve Weblate
responsiveness, but might require more resources for the database server.
Please consult [`CONN_MAX_AGE`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-CONN_MAX_AGE) and
[Persistent connections](https://docs.djangoproject.com/en/stable/ref/databases/#persistent-database-connections) for more info.

Weblate needs at least the following number of connections:

* $(4 \times \mathit{nCPUs}) + 2$ for Celery processes
* $\mathit{nCPUs} + 1$ for WSGI workers

This applies to Docker container defaults and example configurations provided
in this documentation, but the numbers will change once you customize the amount of
WSGI workers or adjust parallelism of Celery.

The actual limit for the number of database connections needs to be higher to
account for the following situations:

* [Comenzi de gestionare](https://docs.weblate.org/ro/latest/admin/management.md#manage) need their connection as well.
* If a process is killed (for example by OOM killer), it might block the existing connection until timeout.

#### SEE ALSO
[Sarcini de fundal folosind Celery](#celery),
[Exemplu de configurare pentru NGINX și uWSGI](#uwsgi),
[`WEBLATE_WORKERS`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_WORKERS)

<a id="postgresql"></a>

### PostgreSQL

PostgreSQL este, de obicei, cea mai bună alegere pentru site-urile bazate pe Django. Este baza de date de referință utilizată pentru implementarea stratului de baze de date Django.

#### NOTE
Weblate utilizează extensia Trigram, care trebuie instalată separat în unele cazuri. Căutați `postgresql-contrib` sau un pachet cu nume similar.

#### SEE ALSO
[PostgreSQL notes](https://docs.djangoproject.com/en/stable/ref/databases/#postgresql-notes)

<a id="dbsetup-postgres"></a>

#### Crearea unei baze de date în PostgreSQL

De obicei, este o idee bună să executați Weblate într-o bază de date separată și într-un cont de utilizator separat:

```sh
# If PostgreSQL was not installed before, set the main password
sudo -u postgres psql postgres -c "\password postgres"

# Create a database user called "weblate"
sudo -u postgres createuser --superuser --pwprompt weblate

# Create the database "weblate" owned by "weblate"
sudo -u postgres createdb -E UTF8 -O weblate weblate
```

#### HINT
Dacă nu doriți să faceți din utilizatorul Weblate un superutilizator în PostgreSQL, puteți omite acest lucru. În acest caz, va trebui să efectuați manual unele dintre etapele de migrare ca superutilizator PostgreSQL în schema pe care o va folosi Weblate:

```postgres
CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE EXTENSION IF NOT EXISTS btree_gin;
CREATE EXTENSION IF NOT EXISTS btree_gist;
```

<a id="config-postgresql"></a>

#### Configurarea Weblate pentru a utiliza PostgreSQL

Fragmentul `settings.py` pentru PostgreSQL:

```python
DATABASES = {
    "default": {
        # Database engine
        "ENGINE": "django.db.backends.postgresql",
        # Database name
        "NAME": "weblate",
        # Database user
        "USER": "weblate",
        # Configures name of the PostgreSQL role to alter during the database migration
        # "ALTER_ROLE": "weblate",
        # Database password
        "PASSWORD": "password",
        # Set to empty string for localhost
        "HOST": "database.example.com",
        # Set to empty string for default
        "PORT": "",
        # Persistent connections
        "CONN_MAX_AGE": None,
        "CONN_HEALTH_CHECKS": True,
    }
}
```

The database migration performs [ALTER ROLE](https://www.postgresql.org/docs/16/sql-alterrole.html) on the database role used
by Weblate. In most cases, the name of the role matches the username. In more
complex setups the role name is different from the username, and you will get an error
about non-existing role during the database migration
(`psycopg2.errors.UndefinedObject: role "weblate@hostname" does not exist`).
This is known to happen with Azure Database for PostgreSQL, but it’s not
limited to this environment. Please set `ALTER_ROLE` to change the name of the
role Weblate should alter during the database migration.

#### SEE ALSO
[Database connections](#db-connections)

## Alte configurații

<a id="out-mail"></a>

### Configurarea e-mailului de ieșire

Weblate trimite e-mailuri cu diferite ocazii - pentru activarea contului și la diferite notificări configurate de utilizatori. Pentru aceasta are nevoie de acces la un server SMTP.

Configurarea serverului de poștă electronică este configurată cu ajutorul acestor setări: [`EMAIL_HOST`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-EMAIL_HOST), [`EMAIL_HOST_PASSWORD`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-EMAIL_HOST_PASSWORD), [`EMAIL_USE_TLS`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-EMAIL_USE_TLS), [`EMAIL_USE_SSL`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-EMAIL_USE_SSL), [`EMAIL_HOST_USER`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-EMAIL_HOST_USER) și [`EMAIL_PORT`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-EMAIL_PORT). Numele lor sunt destul de explicite, dar puteți găsi mai multe informații în documentația Django.

#### HINT
In case you get error about not supported authentication (for example
`SMTP AUTH extension not supported by server`), it is most likely caused
by using insecure connection and server refuses to authenticate this way.
Try enabling [`EMAIL_USE_TLS`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-EMAIL_USE_TLS) in such case.

#### SEE ALSO
* [Nu primiți e-mailuri de la Weblate](https://docs.weblate.org/ro/latest/contributing/debugging.md#debug-mails)
* [Configuring outgoing e-mail in Docker container](https://docs.weblate.org/ro/latest/admin/install/docker.md#docker-mail)

<a id="reverse-proxy"></a>

### Rularea în spatele unui proxy invers

Several features in Weblate rely on correct HTTP headers being passed to
Weblate. When using reverse proxy, please make sure that the needed information
is correctly passed.

To debug this configuration, you can look at HTTP environment in
[Raport de performanță](https://docs.weblate.org/ro/latest/admin/admin.md#manage-performance).

Client IP address
: This is needed for [Limitarea ratei](https://docs.weblate.org/ro/latest/admin/optionals.md#rate-limit) or [Jurnal de audit](https://docs.weblate.org/ro/latest/user/profile.md#audit-log).
  <br/>
  Weblate parses IP address from the `REMOTE_ADDR`, which is set by the WSGI
  handler. This might be empty (when using socket for WSGI) or contain a
  reverse proxy address, so Weblate needs an additional HTTP header with
  a client IP address.
  <br/>
  Enabling [`IP_BEHIND_REVERSE_PROXY`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-IP_BEHIND_REVERSE_PROXY) should be sufficient for the most
  usual setups, but you might need to adjust [`IP_PROXY_HEADER`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-IP_PROXY_HEADER) and
  [`IP_PROXY_OFFSET`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-IP_PROXY_OFFSET) as well (use [`WEBLATE_IP_PROXY_HEADER`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_IP_PROXY_HEADER)
  and [`WEBLATE_IP_PROXY_OFFSET`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_IP_PROXY_OFFSET) in the Docker container).
  <br/>
  The reverse proxy which connects to Weblate must overwrite the configured
  header or append a verified peer address at the position selected by
  [`IP_PROXY_OFFSET`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-IP_PROXY_OFFSET). Do not select a client-supplied address, and do
  not expose the application server through a path which bypasses the trusted
  proxy.
  <br/>
  When using `X-Forwarded-For` with the Docker container, configure
  [`WEBLATE_TRUSTED_PROXY_ADDRESSES`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_TRUSTED_PROXY_ADDRESSES) with the reverse proxies allowed
  to supply client addresses.
  <br/>
  #### HINT
  This configuration cannot be turned on by default, because it would allow IP
  address spoofing on installations that don’t have a properly configured
  reverse proxy.

Server host name
: The [Host](https://www.rfc-editor.org/rfc/rfc7230#section-5.4) header should match to whatever is configured as
  [`SITE_DOMAIN`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-SITE_DOMAIN). Additional configuration might be needed in your
  reverse proxy (for example use `ProxyPreserveHost On` for Apache or
  `proxy_set_header Host $host;` with nginx).
  <br/>
  #### HINT
  CSRF verification failed errors are often caused by a mismatch between
  the [Host](https://www.rfc-editor.org/rfc/rfc7230#section-5.4) header and configured [`SITE_DOMAIN`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-SITE_DOMAIN).

Client protocol
: Not passing correct protocol may cause Weblate to end up in redirection
  loop trying to upgrade client to HTTPS. Make sure it is correctly exposed by
  the reverse proxy as *X-Forwarded-Proto*.
  <br/>
  This header then needs to be configured in
  [`SECURE_PROXY_SSL_HEADER`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-SECURE_PROXY_SSL_HEADER) (`settings.py`) or
  [`WEBLATE_SECURE_PROXY_SSL_HEADER`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_SECURE_PROXY_SSL_HEADER) (Docker environment).
  <br/>
  #### IMPORTANT
  The header value is case-sensitive in the configuration, so
  `WEBLATE_SECURE_PROXY_SSL_HEADER=HTTP_X_FORWARDED_PROTO,https` and
  `WEBLATE_SECURE_PROXY_SSL_HEADER=HTTP_X_FORWARDED_PROTO,HTTPS` are not
  interchangeable.
  <br/>
  #### HINT
  If you are getting a „Too many redirects” error from the browser, this is
  most likely caused by mismatch between the actual protocol (HTTPS) and
  what is observed by Weblate.
  <br/>
  #### Versionchanged
  Schimbat în versiunea 5.13: The protocol proxy headers are automatically handled by
  **gunicorn** in the default configuration, but other WSGI servers
  have more secure configuration and require explicit setting of this.
  <br/>
  Since Weblate 5.13 the Docker container is using **granian** and
  it now requires the explicit configuration of
  [`WEBLATE_SECURE_PROXY_SSL_HEADER`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_SECURE_PROXY_SSL_HEADER).

#### SEE ALSO
* [SSL terminating proxy](https://docs.weblate.org/ro/latest/admin/install/docker.md#docker-ssl-proxy)
* [Limitarea ratei](https://docs.weblate.org/ro/latest/admin/optionals.md#rate-limit)
* [Jurnal de audit](https://docs.weblate.org/ro/latest/user/profile.md#audit-log)
* [Sample configuration for NGINX and Granian](#nginx-granian)
* [Sample configuration for NGINX and Gunicorn](#nginx-gunicorn)
* [Exemplu de configurare pentru NGINX și uWSGI](#uwsgi)
* [Exemplu de configurare pentru Apache](#apache)
* [Exemplu de configurare pentru Apache și Gunicorn](#apache-gunicorn)
* [`IP_BEHIND_REVERSE_PROXY`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-IP_BEHIND_REVERSE_PROXY)
* [`IP_PROXY_HEADER`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-IP_PROXY_HEADER)
* [`IP_PROXY_OFFSET`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-IP_PROXY_OFFSET)
* [`SECURE_PROXY_SSL_HEADER`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-SECURE_PROXY_SSL_HEADER)
* [`WEBLATE_IP_PROXY_HEADER`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_IP_PROXY_HEADER)
* [`WEBLATE_TRUSTED_PROXY_ADDRESSES`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_TRUSTED_PROXY_ADDRESSES)
* [`WEBLATE_IP_PROXY_OFFSET`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_IP_PROXY_OFFSET)

<a id="http-proxy"></a>

### HTTP proxy

Weblate supports per-protocol HTTP proxy configuration for outbound HTTP
requests and Git repositories. Define the proxy environment variables in
`settings.py`:

```python
import os

os.environ["http_proxy"] = "http://proxy.example.com:8080"
os.environ["https_proxy"] = "http://proxy.example.com:8080"
```

Only `http_proxy` and `https_proxy` are supported. Generic and bypass
variables such as `all_proxy` and `no_proxy`, operating-system proxy
configuration, and VCS-specific proxy configuration are not supported.

#### SEE ALSO
[Proxy environment variables](https://everything.curl.dev/usingcurl/proxies/env.html)

<a id="configuration"></a>

## Ajustarea configurației

#### SEE ALSO
[Exemplu de configurare](https://docs.weblate.org/ro/latest/admin/sample.md#sample-configuration)

Copiați `weblate/settings_example.py` în `weblate/settings.py` și ajustați-l pentru a se potrivi cu configurația dumneavoastră. Probabil că veți dori să ajustați următoarele opțiuni:

<a id="std-setting-ADMINS"></a>

`ADMINS`

> Lista de administratori de site care trebuie să primească notificări atunci când ceva nu merge bine, de exemplu, notificări privind fuziunile eșuate sau erorile Django.

> Contact form sends e-mail on these as well unless [`ADMINS_CONTACT`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-ADMINS_CONTACT)
> is configured.

> #### SEE ALSO
> * [`ADMINS`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-ADMINS)
> * [`ADMINS_CONTACT`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-ADMINS_CONTACT)
> * [Configurați în mod corespunzător administratorii](#production-admins)

<a id="std-setting-ALLOWED_HOSTS"></a>

`ALLOWED_HOSTS`

> Trebuie să setați acest lucru pentru a lista gazdele pe care site-ul tău trebuie să le deservească. De exemplu:

> ```python
> ALLOWED_HOSTS = ["demo.weblate.org"]
> ```

> Alternativ, puteți include caractere wildcard:

> ```python
> ALLOWED_HOSTS = ["*"]
> ```

> #### SEE ALSO
> * [`ALLOWED_HOSTS`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-ALLOWED_HOSTS)
> * [`WEBLATE_ALLOWED_HOSTS`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_ALLOWED_HOSTS)
> * [Configurarea gazdelor permise](#production-hosts)

<a id="std-setting-SESSION_ENGINE"></a>

`SESSION_ENGINE`

> Configurați modul în care vor fi stocate sesiunile dvs. În cazul în care păstrați motorul implicit al bazei de date backend, ar trebui să programați: **weblate clearsessions** pentru a elimina din baza de date datele vechi ale sesiunilor.

> If you are using Valkey or Redis as cache (see [Configure cache](#production-cache)) it is
> recommended to use it for sessions as well:

> ```python
> SESSION_ENGINE = "django.contrib.sessions.backends.cache"
> ```

> #### SEE ALSO
> * [Configuring the session engine](https://docs.djangoproject.com/en/stable/topics/http/sessions/#configuring-sessions)
> * [`SESSION_ENGINE`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-SESSION_ENGINE)

<a id="std-setting-DATABASES"></a>

`DATABASES`

> Conectivitatea la serverul de baze de date, vă rugăm să consultați documentația Django pentru mai multe detalii.

> #### SEE ALSO
> * [Configurarea bazei de date pentru Weblate](#database-setup)
> * [`DATABASES`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-DATABASES)
> * [Databases](https://docs.djangoproject.com/en/stable/ref/databases/)

<a id="std-setting-DEBUG"></a>

`DEBUG`

> Dezactivați acest lucru pentru orice server de producție. Cu modul de depanare activat, Django va arăta utilizatorilor backtraces în caz de eroare, când îl dezactivați, erorile vor fi trimise prin e-mail către `ADMINS` (vezi mai sus).

> Modul de depanare încetinește, de asemenea, Weblate, deoarece Django stochează mult mai multe informații pe plan intern în acest caz.

> #### SEE ALSO
> * [`DEBUG`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-DEBUG)
> * [Dezactivați modul de depanare](#production-debug)

<a id="std-setting-DEFAULT_FROM_EMAIL"></a>

`DEFAULT_FROM_EMAIL`

> Adresa de e-mail a expeditorului pentru e-mailurile de ieșire, de exemplu e-mailurile de înregistrare.

> #### SEE ALSO
> [`DEFAULT_FROM_EMAIL`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-DEFAULT_FROM_EMAIL)

<a id="std-setting-SECRET_KEY"></a>

`SECRET_KEY`

> Cheia folosită de Django pentru a semna unele informații în cookie-uri, vezi [Cheia secretă Django](#production-secret) pentru mai multe informații.

> #### SEE ALSO
> [`SECRET_KEY`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-SECRET_KEY)

<a id="std-setting-SERVER_EMAIL"></a>

`SERVER_EMAIL`

> E-mail utilizat ca adresă de expeditor pentru trimiterea de e-mailuri către administrator, de exemplu notificări privind fuziunile eșuate.

> #### SEE ALSO
> [`SERVER_EMAIL`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-SERVER_EMAIL)

<a id="tables-setup"></a>

## Completarea bazei de date

After your configuration is ready, you can run
[`migrate`](https://docs.weblate.org/ro/latest/admin/management.md#weblate-admin-migrate) to create the database structure. Now you should be
able to create translation projects using the admin interface.

După ce ați terminat, ar trebui, de asemenea, să verificați Raportul de performanță din interfața de administrare, care vă va oferi indicii cu privire la o potențială configurație neoptimă a site-ului dumneavoastră.

#### SEE ALSO
* [Configurație](https://docs.weblate.org/ro/latest/admin/config.md#config)
* [List of privileges](https://docs.weblate.org/ro/latest/admin/access.md#privileges)

<a id="production"></a>

## Configurarea producției

Pentru o configurație de producție, trebuie să efectuați ajustările descrise în secțiunile următoare. Cele mai critice setări vor declanșa un avertisment, care este indicat printr-un semn de exclamare în bara de sus dacă sunteți conectat ca superutilizator:

![image](screenshots/admin-wrench.webp)

De asemenea, se recomandă să inspectați verificările declanșate de Django (deși s-ar putea să nu fie nevoie să le reparați pe toate):

```sh
weblate check --deploy
```

You can also review the very same checklist at [Raport de performanță](https://docs.weblate.org/ro/latest/admin/admin.md#manage-performance) in the [Interfața de gestionare](https://docs.weblate.org/ro/latest/admin/admin.md#management-interface).

#### SEE ALSO
[Deployment checklist](https://docs.djangoproject.com/en/stable/howto/deployment/checklist/)

<a id="production-debug"></a>

### Dezactivați modul de depanare

Dezactivați modul de depanare al lui Django ([`DEBUG`](#std-setting-DEBUG)) prin:

```python
DEBUG = False
```

Cu modul de depanare activat, Django stochează toate interogările executate și arată utilizatorilor traseele erorilor, ceea ce nu este de dorit într-o configurație de producție.

#### SEE ALSO
[Ajustarea configurației](#configuration)

<a id="production-admins"></a>

### Configurați în mod corespunzător administratorii

Set the correct admin addresses to the [`ADMINS`](#std-setting-ADMINS) setting to define who will receive
e-mails in case something goes wrong on the server, for example:

```python
ADMINS = ("Your Name <your_email@example.com>",)
```

#### SEE ALSO
[Ajustarea configurației](#configuration)

<a id="production-site"></a>

### Setați domeniul corect al site-ului

Ajustați numele site-ului și domeniul în interfața de administrare, altfel linkurile din RSS sau din e-mailurile de înregistrare nu vor funcționa. Acest lucru este configurat cu ajutorul [`SITE_DOMAIN`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-SITE_DOMAIN) care trebuie să conțină numele domeniului site-ului.

#### Versionchanged
Schimbat în versiunea 4.2: Înainte de versiunea 4.2, a fost folosit în schimb cadrul Django sites, consultați [The “sites” framework](https://docs.djangoproject.com/en/stable/ref/contrib/sites/).

#### SEE ALSO
* [Configurarea gazdelor permise](#production-hosts)
* [Configurați corect HTTPS](#production-ssl)
* [`SITE_DOMAIN`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-SITE_DOMAIN)
* [`WEBLATE_SITE_DOMAIN`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_SITE_DOMAIN)
* [`ENABLE_HTTPS`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-ENABLE_HTTPS)

<a id="production-ssl"></a>

### Configurați corect HTTPS

Se recomandă cu tărie să executați Weblate utilizând protocolul HTTPS criptat. După ce îl activați, trebuie să setați [`ENABLE_HTTPS`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-ENABLE_HTTPS) în setări:

```python
ENABLE_HTTPS = True
```

#### HINT
Este posibil să doriți să configurați și HSTS, consultați [SSL/HTTPS](https://docs.djangoproject.com/en/stable/topics/security/#security-recommendation-ssl) pentru mai multe detalii.

#### SEE ALSO
* [`ENABLE_HTTPS`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-ENABLE_HTTPS)
* [Configurarea gazdelor permise](#production-hosts)
* [Setați domeniul corect al site-ului](#production-site)

### Setați corect SECURE_HSTS_SECONDS

Dacă site-ul tău este servit prin SSL, trebuie să ai în vedere setarea unei valori pentru [`SECURE_HSTS_SECONDS`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-SECURE_HSTS_SECONDS) în `settings.py` pentru a activa HTTP Strict Transport Security. În mod implicit, este setată la 0, așa cum se arată mai jos.

```python
SECURE_HSTS_SECONDS = 0
```

Dacă este setat la o valoare întreagă diferită de zero, [`django.middleware.security.SecurityMiddleware`](https://docs.djangoproject.com/en/stable/ref/middleware/#django.middleware.security.SecurityMiddleware) setează antetul [HTTP Strict Transport Security](https://docs.djangoproject.com/en/stable/ref/middleware/#http-strict-transport-security) pe toate răspunsurile care nu îl au deja.

#### WARNING
Setarea incorectă a acestui parametru vă poate distruge ireversibil (pentru o perioadă de timp) site-ul. Citiți mai întâi documentația [HTTP Strict Transport Security](https://docs.djangoproject.com/en/stable/ref/middleware/#http-strict-transport-security).

<a id="production-database"></a>

### Utilizați un motor de baze de date puternic

* Vă rugăm să folosiți PostgreSQL pentru un mediu de producție, consultați [Configurarea bazei de date pentru Weblate](#database-setup) pentru mai multe informații.
* Folosiți o locație adiacentă pentru a rula serverul de baze de date, în caz contrar performanța sau fiabilitatea rețelei ar putea să vă distrugă experiența Weblate.
* Verificați performanța serverului de baze de date sau modificați configurația acestuia, de exemplu folosind [PGTune](https://pgtune.leopard.in.ua/).
* Weblate deployment checks report non-finite PostgreSQL relation statistics.
  Run `ANALYZE` on the reported relations to rebuild corrupted statistics.

#### SEE ALSO
* [Configurarea bazei de date pentru Weblate](#database-setup)
* [Migrarea de la alte baze de date la PostgreSQL](https://docs.weblate.org/ro/latest/admin/upgrade.md#database-migration)
* [Ajustarea configurației](#configuration)
* [Databases](https://docs.djangoproject.com/en/stable/ref/databases/)

<a id="production-cache"></a>

### Configure cache

If possible, use Valkey or Redis from Django by adjusting the `CACHES`
configuration variable, for example:

```python
CACHES = {
    "default": {
        "BACKEND": "django_redis.cache.RedisCache",
        "LOCATION": "redis://127.0.0.1:6379/0",
        # If redis is running on same host as Weblate, you might
        # want to use unix sockets instead:
        # 'LOCATION': 'unix:///var/run/redis/redis.sock?db=0',
        "OPTIONS": {
            "CLIENT_CLASS": "django_redis.client.DefaultClient",
            "PARSER_CLASS": "redis.connection.HiredisParser",
        },
    }
}
```

#### HINT
In case you change settings for the cache, you might need to adjust them for
Celery as well, see [Sarcini de fundal folosind Celery](#celery).

#### SEE ALSO
* [Avatar în memoria cache](#production-cache-avatar)
* [Django’s cache framework](https://docs.djangoproject.com/en/stable/topics/cache/)

<a id="production-cache-avatar"></a>

### Avatar în memoria cache

În plus față de memoria cache a lui Django, Weblate realizează și memoria cache a avatarelor. În acest scop, se recomandă utilizarea unui cache separat, susținut de fișiere:

```python
CACHES = {
    "default": {
        # Default caching backend setup, see above
        "BACKEND": "django_redis.cache.RedisCache",
        "LOCATION": "unix:///var/run/redis/redis.sock?db=0",
        "OPTIONS": {
            "CLIENT_CLASS": "django_redis.client.DefaultClient",
            "PARSER_CLASS": "redis.connection.HiredisParser",
        },
    },
    "avatar": {
        "BACKEND": "django.core.cache.backends.filebased.FileBasedCache",
        "LOCATION": os.path.join(DATA_DIR, "avatar-cache"),
        "TIMEOUT": 604800,
        "OPTIONS": {
            "MAX_ENTRIES": 1000,
        },
    },
}
```

#### SEE ALSO
* [`ENABLE_AVATARS`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-ENABLE_AVATARS)
* [`AVATAR_URL_PREFIX`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-AVATAR_URL_PREFIX)
* [Avataruri](https://docs.weblate.org/ro/latest/admin/optionals.md#avatars)
* [Configure cache](#production-cache)
* [Django’s cache framework](https://docs.djangoproject.com/en/stable/topics/cache/)

<a id="production-email"></a>

### Configurați trimiterea de e-mailuri

Weblate trebuie să trimită e-mailuri în mai multe ocazii, iar aceste e-mailuri trebuie să aibă o adresă de expeditor corectă, vă rugăm să configurați [`SERVER_EMAIL`](#std-setting-SERVER_EMAIL) și [`DEFAULT_FROM_EMAIL`](#std-setting-DEFAULT_FROM_EMAIL) pentru a se potrivi cu mediul dumneavoastră, de exemplu:

```python
SERVER_EMAIL = "admin@example.org"
DEFAULT_FROM_EMAIL = "weblate@example.org"
```

#### NOTE
Pentru a dezactiva trimiterea de e-mailuri prin Weblate, setați [`EMAIL_BACKEND`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-EMAIL_BACKEND) la `django.core.mail.backends.dummy.EmailBackend`.

Acest lucru va dezactiva *toată* livrarea de e-mailuri, inclusiv e-mailurile de înregistrare sau de resetare a parolei.

#### SEE ALSO
* [Ajustarea configurației](#configuration)
* [Configurarea e-mailului de ieșire](#out-mail)
* [`EMAIL_BACKEND`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-EMAIL_BACKEND)
* [`DEFAULT_FROM_EMAIL`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-DEFAULT_FROM_EMAIL)
* [`SERVER_EMAIL`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-SERVER_EMAIL)

<a id="production-hosts"></a>

### Configurarea gazdelor permise

Django are nevoie ca [`ALLOWED_HOSTS`](#std-setting-ALLOWED_HOSTS) să conțină o listă de nume de domenii pe care site-ul tău are voie să le servească, dacă o lași goală va bloca orice cerere.

În cazul în care acesta nu este configurat pentru a se potrivi cu serverul dumneavoastră HTTP, veți primi erori de tipul `Invalid HTTP_HOST header: '1.1.1.1'. You may need to add '1.1.1.1' to ALLOWED_HOSTS.`

#### HINT
Pe containerul Docker, acest lucru este disponibil ca [`WEBLATE_ALLOWED_HOSTS`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_ALLOWED_HOSTS).

#### SEE ALSO
* [`ALLOWED_HOSTS`](#std-setting-ALLOWED_HOSTS)
* [`WEBLATE_ALLOWED_HOSTS`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_ALLOWED_HOSTS)
* [Setați domeniul corect al site-ului](#production-site)

<a id="production-secret"></a>

### Cheia secretă Django

Setarea [`SECRET_KEY`](#std-setting-SECRET_KEY) este folosită de Django pentru a semna cookie-urile și ar trebui să vă generați propria valoare, mai degrabă decât să o folosiți pe cea din exemplul de configurare.

Puteți genera o cheie nouă utilizând **weblate-generate-secret-key** livrat cu Weblate.

#### SEE ALSO
[`SECRET_KEY`](#std-setting-SECRET_KEY)

<a id="production-cron"></a>

### Executarea sarcinilor de întreținere

For optimal performance, it is good idea to run some maintenance tasks in the
background. This is automatically done by [Sarcini de fundal folosind Celery](#celery) and covers following tasks:

* Verificarea stării de sănătate a configurației (din oră în oră).
* Committing pending changes (hourly), see [Angajări leneșe](https://docs.weblate.org/ro/latest/admin/continuous.md#lazy-commit) and [`commit_pending`](https://docs.weblate.org/ro/latest/admin/management.md#weblate-admin-commit_pending).
* Actualizarea alertelor privind componentele (zilnic).
* Actualizarea ramurilor la distanță (noaptea), vezi [`AUTO_UPDATE`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-AUTO_UPDATE).
* Translation memory backup to JSON (daily), see [`dump_memory`](https://docs.weblate.org/ro/latest/admin/management.md#weblate-admin-dump_memory).
* Fulltext and database maintenance tasks (daily and weekly tasks), see [`cleanuptrans`](https://docs.weblate.org/ro/latest/admin/management.md#weblate-admin-cleanuptrans).

<a id="production-encoding"></a>

### Locațiile și codificarea sistemului

Locațiile de sistem trebuie configurate cu cele care acceptă UTF-8. Pe majoritatea distribuțiilor Linux, aceasta este setarea implicită. În cazul în care nu este cazul în sistemul dumneavoastră, vă rugăm să schimbați localele în varianta UTF-8.

De exemplu, prin editarea `/etc/default/locale` și setarea acolo `LANG="C.UTF-8"`.

În unele cazuri, serviciile individuale au o configurație separată pentru localități. Acest lucru variază în funcție de distribuție și de serverele web, așa că verifică documentația pachetelor serverului tău web.

Apache pe Ubuntu utilizează `/etc/apache2/envvars`:

```sh
export LANG='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'
```

Apache pe CentOS utilizează `/etc/sysconfig/httpd` (sau `/opt/rh/httpd24/root/etc/sysconfig/httpd`):

```sh
LANG='en_US.UTF-8'
```

<a id="production-certs"></a>

### Utilizarea autorității de certificare personalizate

Weblate verifies SSL certificates during HTTP requests. Requests made using
HTTPX2 use the system certificate store, so install custom certificate
authorities there.

Check your distribution documentation for more details. For example, on Debian
this can be done by placing the CA certificate into
`/usr/local/share/ca-certificates/` and running
**update-ca-certificates**.

#### HINT
The Weblate container does not include it in the search path, you need to
specify full path to execute it. For example:

```sh
docker compose exec -u root weblate /usr/sbin/update-ca-certificates
```

Once this is done, Weblate HTTPX2 requests and system tools, including Git, will
trust the certificate.

Some integrations, including OAuth and OpenID Connect authentication, use
Requests, which does not use the system certificate store by default. When
these integrations communicate with services using the custom certificate
authority, configure Requests to use the system CA bundle by adding the
following to `settings.py` (the path is Debian-specific):

```python
import os

os.environ["REQUESTS_CA_BUNDLE"] = "/etc/ssl/certs/ca-certificates.crt"
```

<a id="server"></a>

## Rularea serverului

#### HINT
În cazul în care nu aveți experiență cu serviciile descrise mai jos, ați putea încerca [Instalarea folosind Docker](https://docs.weblate.org/ro/latest/admin/install/docker.md).

Veți avea nevoie de mai multe servicii pentru a rula Weblate, configurația recomandată constă în:

* Server de baze de date (vezi [Configurarea bazei de date pentru Weblate](#database-setup))
* Server cache (vezi [Configure cache](#production-cache))
* Server web frontend pentru fișiere statice și terminarea SSL (vezi [Servirea fișierelor statice](#static-files))
* Server WSGI pentru conținut dinamic (vezi [Exemplu de configurare pentru NGINX și uWSGI](#uwsgi))
* Celery pentru executarea de sarcini de fundal (vezi [Sarcini de fundal folosind Celery](#celery))

#### NOTE
Există unele dependențe între servicii, de exemplu, memoria cache și baza de date trebuie să ruleze la pornirea proceselor Celery sau uwsgi.

În cele mai multe cazuri, veți rula toate serviciile pe un singur server (virtual), dar în cazul în care instalația dvs. este foarte încărcată, puteți împărți serviciile. Singura limitare în acest sens este că serverele Celery și Wsgi au nevoie de acces la [`DATA_DIR`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-DATA_DIR).

#### NOTE
Procesul WSGI trebuie să fie executat sub același utilizator ca și procesul Celery, în caz contrar fișierele din [`DATA_DIR`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-DATA_DIR) vor fi stocate cu proprietate mixtă, ceea ce duce la probleme în timpul execuției.

A se vedea [Permisiunile sistemului de fișiere](#file-permissions) și [Sarcini de fundal folosind Celery](#celery).

### Rularea serverului web

Running Weblate is not different from running any other Django based
program. Django is usually executed as WSGI or fcgi (see examples for
different webservers below).

#### NOTE
The sample configuration files shown below are maintained in the Weblate
source tree under `weblate/examples/`. They are included in source
distributions and in this documentation, but Python wheels only install
runtime files. When installing Weblate from PyPI, get the matching source
distribution or source checkout before copying these examples.

În scopuri de testare, puteți utiliza serverul web încorporat în Django:

```sh
weblate runserver
```

#### WARNING
NU FOLOSIȚI ACEST SERVER ÎNTR-UN MEDIU DE PRODUCȚIE. Acesta nu a fost supus unor audituri de securitate sau teste de performanță. Consultați, de asemenea, documentația Django privind [`runserver`](https://docs.djangoproject.com/en/stable/ref/django-admin/#django-admin-runserver).

#### HINT
The Django built-in server serves static files only with [`DEBUG`](#std-setting-DEBUG)
enabled as it is intended for development only. For production use, please
see WSGI setups:

* [Sample configuration for NGINX and Granian](#nginx-granian)
* [Sample configuration for NGINX and Gunicorn](#nginx-gunicorn)
* [Exemplu de configurare pentru NGINX și uWSGI](#uwsgi)
* [Exemplu de configurare pentru Apache](#apache)
* [Exemplu de configurare pentru Apache și Gunicorn](#apache-gunicorn)
* [Servirea fișierelor statice](#static-files)

<a id="static-files"></a>

### Servirea fișierelor statice

#### Versionchanged
Schimbat în versiunea 5.15.2: `/media/` is no longer used for serving screenshots.

Django needs to collect its static files in a single directory. To do so,
execute `weblate collectstatic --noinput`. This will copy the static
files into a directory specified by the [`STATIC_ROOT`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-STATIC_ROOT) setting (this defaults to
a `static` directory inside [`CACHE_DIR`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-CACHE_DIR)). Production installations
use content hashes in collected filenames so that updated assets do not reuse
stale browser or proxy caches.

Se recomandă să serviți fișiere statice direct de pe serverul dvs. web, ar trebui să folosiți acest lucru pentru următoarele căi:

`/static/`
: Serves static files for Weblate and the admin interface
  (from defined by [`STATIC_ROOT`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-STATIC_ROOT)).

`/favicon.ico`
: Should be rewritten to serve `/static/favicon.ico`.

#### SEE ALSO
* [Sample configuration for NGINX and Granian](#nginx-granian)
* [Sample configuration for NGINX and Gunicorn](#nginx-gunicorn)
* [Exemplu de configurare pentru NGINX și uWSGI](#uwsgi)
* [Exemplu de configurare pentru Apache](#apache)
* [Exemplu de configurare pentru Apache și Gunicorn](#apache-gunicorn)
* [How to deploy Django](https://docs.djangoproject.com/en/stable/howto/deployment/)
* [How to deploy static files](https://docs.djangoproject.com/en/stable/howto/static-files/deployment/)

<a id="csp"></a>

### Politica de securitate a conținutului

The default Weblate configuration enables `weblate.middleware.SecurityMiddleware`
middleware which sets security related HTTP headers like *Content-Security-Policy*
or *X-XSS-Protection*. These are by default set up to work with Weblate and its
configuration, but this might need customization for your environment.

#### SEE ALSO
* [`CSP_SCRIPT_SRC`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-CSP_SCRIPT_SRC)
* [`CSP_IMG_SRC`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-CSP_IMG_SRC)
* [`CSP_CONNECT_SRC`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-CSP_CONNECT_SRC)
* [`CSP_STYLE_SRC`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-CSP_STYLE_SRC)
* [`CSP_FONT_SRC`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-CSP_FONT_SRC)
* [`CSP_FORM_SRC`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-CSP_FORM_SRC)

<a id="nginx-granian"></a>

### Sample configuration for NGINX and Granian

The following configuration runs Weblate using Granian with the NGINX webserver:

```nginx
#
# nginx configuration for Weblate
#
# You will want to change:
#
# - server_name
# - change /home/weblate/weblate-env to location where Weblate Python environment is placed
# - change /home/weblate/data to match your DATA_DIR
# - change /home/weblate/data/cache to match your CACHE_DIR
# - change python3.12 to match your Python version
# - change weblate user to match your Weblate user
#
server {
    listen 80;
    server_name weblate;
    # Not used
    root /var/www/html;

    location ~ ^/favicon.ico$ {
        # CACHE_DIR/static/favicon.ico
        alias /home/weblate/data/cache/static/favicon.ico;
        expires 30d;
    }

    location /static/ {
        # CACHE_DIR/static/
        alias /home/weblate/data/cache/static/;
        expires 30d;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:8888;
        proxy_read_timeout 3600;
    }
}
```

#### SEE ALSO
* [Sample configuration to start Granian](#running-granian)
* [https://github.com/emmett-framework/granian](https://github.com/emmett-framework/granian)
* [How to deploy with WSGI](https://docs.djangoproject.com/en/stable/howto/deployment/wsgi/)

<a id="nginx-gunicorn"></a>

### Sample configuration for NGINX and Gunicorn

The following configuration runs Weblate using Gunicorn under the NGINX webserver
(`weblate/examples/weblate.nginx.gunicorn.conf` in the source tree):

```nginx
#
# nginx configuration for Weblate
#
# You will want to change:
#
# - server_name
# - change /home/weblate/weblate-env to location where Weblate Python environment is placed
# - change /home/weblate/data to match your DATA_DIR
# - change /home/weblate/data/cache to match your CACHE_DIR
# - change python3.12 to match your Python version
# - change weblate user to match your Weblate user
#
server {
    listen 80;
    server_name weblate;
    # Not used
    root /var/www/html;

    location ~ ^/favicon.ico$ {
        # CACHE_DIR/static/favicon.ico
        alias /home/weblate/data/cache/static/favicon.ico;
        expires 30d;
    }

    location /static/ {
        # CACHE_DIR/static/
        alias /home/weblate/data/cache/static/;
        expires 30d;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $http_host;
        proxy_pass http://unix:/run/gunicorn.sock;
        proxy_read_timeout 3600;
    }
}
```

#### SEE ALSO
* [Sample configuration to start Gunicorn](#running-gunicorn)
* [How to use Django with Gunicorn](https://docs.djangoproject.com/en/stable/howto/deployment/wsgi/gunicorn/)

<a id="uwsgi"></a>

### Exemplu de configurare pentru NGINX și uWSGI

To run production webserver, use the WSGI wrapper installed with Weblate (when
using a Python environment it is installed as
`~/weblate-env/lib/python3.14/site-packages/weblate/wsgi.py`). Don’t
forget to set the Python search path to your Python environment as well (for
example using `virtualenv = /home/user/weblate-env` in uWSGI).

Următoarea configurație rulează Weblate ca uWSGI sub serverul web NGINX.

Configuration for NGINX (`weblate/examples/weblate.nginx.conf` in the source tree):

```nginx
#
# nginx configuration for Weblate
#
# You will want to change:
#
# - server_name
# - change /home/weblate/weblate-env to location where Weblate Python environment is placed
# - change /home/weblate/data to match your DATA_DIR
# - change /home/weblate/data/cache to match your CACHE_DIR
# - change python3.12 to match your Python version
# - change weblate user to match your Weblate user
#
server {
    listen 80;
    server_name weblate;
    # Not used
    root /var/www/html;

    location ~ ^/favicon.ico$ {
        # CACHE_DIR/static/favicon.ico
        alias /home/weblate/data/cache/static/favicon.ico;
        expires 30d;
    }

    location /static/ {
        # CACHE_DIR/static/
        alias /home/weblate/data/cache/static/;
        expires 30d;
    }

    location / {
        include uwsgi_params;
        # Needed for long running operations in admin interface
        uwsgi_read_timeout 3600;
        # Adjust based to uwsgi configuration:
        uwsgi_pass unix:///run/uwsgi/app/weblate/socket;
        # uwsgi_pass 127.0.0.1:8080;
    }
}
```

Configuration for uWSGI (`weblate/examples/weblate.uwsgi.ini` in the source tree):

```ini
#
# uWSGI configuration for Weblate
#
# You will want to change:
#
# - change /home/weblate/weblate-env to location where Weblate Python environment is placed
# - change /home/weblate/data to match your DATA_DIR
# - change python3.12 to match your Python version
# - change weblate user to match your Weblate user
#
[uwsgi]
plugins       = python3
master        = true
protocol      = uwsgi
socket        = 127.0.0.1:8080
wsgi-file     = /home/weblate/weblate-env/lib/python3.12/site-packages/weblate/wsgi.py

# Add path to Weblate checkout if you did not install
# Weblate by pip
# python-path   = /path/to/weblate

# Path to the Python environment
virtualenv = /home/weblate/weblate-env

# Set sys.executable so Python helpers run with the virtual environment's Python
py-executable = /home/weblate/weblate-env/bin/python

# Needed for OAuth/OpenID
buffer-size   = 8192

# Reload when consuming too much of memory
reload-on-rss = 250

# Increase number of workers for heavily loaded sites
workers       = 8

# Enable threads for Sentry error submission
enable-threads = true

# Child processes do not need file descriptors
close-on-exec = true

# Avoid default 0000 umask
umask = 0022

# Run as weblate user
uid = weblate
gid = weblate

# Enable harakiri mode (kill requests after some time)
# harakiri = 3600
# harakiri-verbose = true

# Enable uWSGI stats server
# stats = :1717
# stats-http = true

# Do not log some errors caused by client disconnects
ignore-sigpipe = true
ignore-write-errors = true
disable-write-exception = true
```

Set `py-executable` to the absolute path of `bin/python` inside the
environment configured by `virtualenv`. Weblate uses Python’s
`sys.executable` to launch helper processes, including the SSH connection
proxy used for Git repositories. uWSGI can otherwise set this value to its own
executable, causing repository operations to fail with an error such as
`/usr/bin/uwsgi-core: invalid option -- 'I'`. Setting `virtualenv` alone does
not ensure that `sys.executable` points to Python. Restart uWSGI after updating
the configuration.

#### SEE ALSO
[How to use Django with uWSGI](https://docs.djangoproject.com/en/stable/howto/deployment/wsgi/uwsgi/)

<a id="apache"></a>

### Exemplu de configurare pentru Apache

Se recomandă utilizarea prefork MPM atunci când se utilizează WSGI cu Weblate.

The following configuration runs Weblate as WSGI, you need to have enabled
`mod_wsgi` (`weblate/examples/apache.conf` in the source tree):

```apache
#
# VirtualHost for Weblate
#
# You will want to change:
#
# - ServerAdmin and ServerName
# - change /home/weblate/weblate-env to location where Weblate Python environment is placed
# - change /home/weblate/data to match your DATA_DIR
# - change /home/weblate/data/cache to match your CACHE_DIR
# - change python3.12 to match Python version mod-wsgi is compiled for
# - change weblate user to match your Weblate user
#
<VirtualHost *:80>
    ServerAdmin admin@weblate.example.org
    ServerName weblate.example.org

    # CACHE_DIR/static/favicon.ico
    Alias /favicon.ico /home/weblate/data/cache/static/favicon.ico

    # CACHE_DIR/static/
    Alias /static/ /home/weblate/data/cache/static/
    <Directory /home/weblate/data/cache/static/>
        Require all granted
    </Directory>

    # Path to your Weblate Python environment
    WSGIDaemonProcess weblate python-home=/home/weblate/weblate-env user=weblate request-timeout=600
    WSGIProcessGroup weblate
    WSGIApplicationGroup %{GLOBAL}

    WSGIScriptAlias / /home/weblate/weblate-env/lib/python3.12/site-packages/weblate/wsgi.py process-group=weblate
    WSGIPassAuthorization On

    <Directory /home/weblate/weblate-env/lib/python3.12/site-packages/weblate/>
        <Files wsgi.py>
        Require all granted
        </Files>
    </Directory>

</VirtualHost>
```

#### NOTE
Weblate necesită Python 3, așa că asigurați-vă că rulați varianta Python 3 a modwsgi. De obicei, acesta este disponibil ca un pachet separat, de exemplu `libapache2-mod-wsgi-py3`.

Use matching Python version to install Weblate.

#### SEE ALSO
* [Locațiile și codificarea sistemului](#production-encoding)
* [How to use Django with Apache and mod_wsgi](https://docs.djangoproject.com/en/stable/howto/deployment/wsgi/modwsgi/)

<a id="apache-gunicorn"></a>

### Exemplu de configurare pentru Apache și Gunicorn

The following configuration runs Weblate in Gunicorn and Apache 2.4
(`weblate/examples/apache.gunicorn.conf` in the source tree):

```apache
#
# VirtualHost for Weblate using gunicorn on localhost:8000
#
# You will want to change:
#
# - ServerAdmin and ServerName
# - change /home/weblate/weblate-env to location where Weblate Python environment is placed
# - change /home/weblate/data to match your DATA_DIR
# - change /home/weblate/data/cache to match your CACHE_DIR
# - change weblate user to match your Weblate user
#
<VirtualHost *:443>
    ServerAdmin admin@weblate.example.org
    ServerName weblate.example.org

    # CACHE_DIR/static/favicon.ico
    Alias /favicon.ico /home/weblate/data/cache/static/favicon.ico

    # CACHE_DIR/static/
    Alias /static/ /home/weblate/data/cache/static/
    <Directory /home/weblate/data/cache/static/>
        Require all granted
    </Directory>

    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/https_cert.cert
    SSLCertificateKeyFile /etc/apache2/ssl/https_key.pem
    SSLProxyEngine On

    ProxyPass /favicon.ico !
    ProxyPass /static/ !

    ProxyPass / http://localhost:8000/
    ProxyPassReverse / http://localhost:8000/
    ProxyPreserveHost On
</VirtualHost>
```

#### SEE ALSO
* [Sample configuration to start Gunicorn](#running-gunicorn)
* [How to use Django with Gunicorn](https://docs.djangoproject.com/en/stable/howto/deployment/wsgi/gunicorn/)

<a id="running-granian"></a>

### Sample configuration to start Granian

Weblate has wsgi optional dependency (see [Dependențe Python](#python-deps)) that will
install everything you need to run Granian. When installing Weblate you can specify it as:

```shell
uv pip install Weblate[all,wsgi]
```

Once you have Granian installed, you can run it. This is usually done at the
system level. The following examples show starting via systemd:

```ini
[Unit]
Description=granian daemon
After=network.target

[Service]
User=weblate
Group=weblate
WorkingDirectory=/home/weblate/weblate-env/
Environment="DJANGO_SETTINGS_MODULE=weblate.settings"
RuntimeDirectory=granian
ExecStart=/home/weblate/weblate-env/bin/granian \
    --no-ws \
    --workers-max-rss 450 \
    --interface wsgi \
    --workers 2 \
    --blocking-threads 8 \
    --backlog 128 \
    --backpressure 16 \
    --runtime-mode mt \
    --port 8888 \
    weblate.wsgi:application

[Install]
WantedBy=multi-user.target
```

Granian uses worker processes for parallel Python execution, blocking threads
for concurrent WSGI requests, and runtime threads for network I/O. The sample
uses two workers with eight blocking threads each, limits each worker to 16
concurrent connections, and leaves the runtime threads at Granian’s default.
Adjust the workers and blocking threads to the available memory, CPU cores, and
database connection limit. Keep the backpressure equal to or higher than the
number of blocking threads.

#### SEE ALSO
* [Sample configuration to start Granian with ASGI](#running-granian-asgi)
* [https://github.com/emmett-framework/granian](https://github.com/emmett-framework/granian)
* [How to deploy with WSGI](https://docs.djangoproject.com/en/stable/howto/deployment/wsgi/)

<a id="running-granian-asgi"></a>

### Sample configuration to start Granian with ASGI

#### Versionadded
Added in version 2026.8.

ASGI deployment is available as an opt-in alternative to WSGI. Install the
`asgi` optional dependency:

```shell
uv pip install Weblate[all,asgi]
```

The following systemd unit runs the Django ASGI application:

```ini
[Unit]
Description=granian ASGI daemon
After=network.target

[Service]
User=weblate
Group=weblate
WorkingDirectory=/home/weblate/weblate-env/
Environment="DJANGO_SETTINGS_MODULE=weblate.settings"
RuntimeDirectory=granian
ExecStart=/home/weblate/weblate-env/bin/granian \
    --no-ws \
    --workers-max-rss 450 \
    --interface asginl \
    --workers 2 \
    --backlog 128 \
    --backpressure 16 \
    --runtime-mode mt \
    --port 8888 \
    weblate.asgi:application

[Install]
WantedBy=multi-user.target
```

The sample uses Granian’s ASGI interface without lifespan or WebSocket support,
because Weblate currently exposes HTTP only. Weblate’s middleware supports both
deployment modes and uses thread-sensitive adapters where it still relies on
synchronous Django APIs. The health check is asynchronous, but most Weblate
views remain synchronous, and CPU-intensive or long-running work should still
be handled by [Sarcini de fundal folosind Celery](#celery).

WSGI remains the default deployment mode. Docker images can opt in to ASGI by
setting [`WEBLATE_ASGI`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_ASGI) to `1`. Adjust the worker count and
backpressure to the available memory, CPU cores, and database connection limit.

#### SEE ALSO
* [Sample configuration to start Granian](#running-granian)
* [https://github.com/emmett-framework/granian](https://github.com/emmett-framework/granian)
* [How to deploy with ASGI](https://docs.djangoproject.com/en/stable/howto/deployment/asgi/)

<a id="running-gunicorn"></a>

### Sample configuration to start Gunicorn

Gunicorn has to be installed separately:

```shell
uv pip install gunicorn
```

Once you have Gunicorn installed, you can run it. This is usually done at the
system level. The following examples show starting via systemd:

```ini
[Unit]
Description=gunicorn socket

[Socket]
ListenStream=/run/gunicorn.sock

[Install]
WantedBy=sockets.target
```

```ini
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target

[Service]
User=weblate
Group=weblate
WorkingDirectory=/home/weblate/weblate-env/
Environment="DJANGO_SETTINGS_MODULE=weblate.settings"
ExecStart=/home/weblate/weblate-env/bin/gunicorn \
    --preload \
    --timeout 3600 \
    --graceful-timeout 3600 \
    --worker-class=gthread \
    --workers=2 \
    --threads=16 \
    --bind unix:/run/gunicorn.sock \
    weblate.wsgi:application

[Install]
WantedBy=multi-user.target
```

#### SEE ALSO
[How to use Django with Gunicorn](https://docs.djangoproject.com/en/stable/howto/deployment/wsgi/gunicorn/)

### Rularea Weblate sub calea de acces

Se recomandă utilizarea prefork MPM atunci când se utilizează WSGI cu Weblate.

A sample Apache configuration to serve Weblate under `/weblate`. Again using
`mod_wsgi` (`weblate/examples/apache-path.conf` in the source tree):

```apache
#
# VirtualHost for Weblate, running under /weblate path
#
# You will want to change:
#
# - ServerAdmin and ServerName
# - change /home/weblate/weblate-env to location where Weblate Python environment is placed
# - change /home/weblate/data to match your DATA_DIR
# - change /home/weblate/data/cache to match your CACHE_DIR
# - change python3.12 to match Python version mod-wsgi is compiled for
# - change weblate user to match your Weblate user
#
<VirtualHost *:80>
    ServerAdmin admin@weblate.example.org
    ServerName weblate.example.org

    # CACHE_DIR/static/favicon.ico
    Alias /weblate/favicon.ico /home/weblate/data/cache/static/favicon.ico

    # CACHE_DIR/static/
    Alias /weblate/static/ /home/weblate/data/cache/static/
    <Directory /home/weblate/data/cache/static/>
        Require all granted
    </Directory>

    # Path to your Weblate Python environment
    WSGIDaemonProcess weblate python-home=/home/weblate/weblate-env user=weblate request-timeout=600
    WSGIProcessGroup weblate
    WSGIApplicationGroup %{GLOBAL}

    WSGIScriptAlias /weblate /home/weblate/weblate-env/lib/python3.12/site-packages/weblate/wsgi.py process-group=weblate
    WSGIPassAuthorization On

    <Directory /home/weblate/weblate-env/lib/python3.12/site-packages/weblate/>
        <Files wsgi.py>
        Require all granted
        </Files>
    </Directory>

</VirtualHost>
```

În plus, va trebui să ajustați `weblate/settings.py`:

```python
URL_PREFIX = "/weblate"
```

<a id="celery"></a>

## Sarcini de fundal folosind Celery

Weblate utilizează Celery pentru a executa sarcini regulate și de fundal. Se presupune că trebuie să rulați un serviciu Celery care să le execute. De exemplu, acesta este responsabil pentru gestionarea următoarelor operațiuni (această listă nu este completă):

* Primirea de webhooks de la servicii externe (a se vedea [Cârlige notificare](https://docs.weblate.org/ro/latest/api.md#hooks)).
* Executarea sarcinilor de întreținere regulate, cum ar fi copii de rezervă, curățări, adăugări zilnice sau actualizări (a se vedea [Copierea de rezervă și mutarea Weblate](https://docs.weblate.org/ro/latest/admin/backup.md#backup), [`BACKGROUND_TASKS`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-BACKGROUND_TASKS), [Suplimente](https://docs.weblate.org/ro/latest/admin/addons.md#addons)).
* Rulează [Traducere automată](https://docs.weblate.org/ro/latest/user/translating.md#auto-translation).
* Trimiterea de notificări de sinteză.
* Offloading expensive operations from the WSGI process.
* Angajarea modificărilor în așteptare (a se vedea [Angajări leneșe](https://docs.weblate.org/ro/latest/admin/continuous.md#lazy-commit)).

A typical setup using Valkey or Redis as a backend looks like this:

```python
CELERY_TASK_ALWAYS_EAGER = False
CELERY_BROKER_URL = "redis://localhost:6379"
CELERY_RESULT_BACKEND = CELERY_BROKER_URL
```

#### SEE ALSO
[Redis broker configuration in Celery](https://docs.celeryq.dev/en/stable/getting-started/backends-and-brokers/redis.html#broker-redis-configuration)

You should also start the Celery worker to process the tasks and start scheduled
tasks. For debugging or development, this can be done directly on the
command-line:

```sh
celery --app=weblate.utils worker --beat \
    --queues=celery,notify,memory,translate,backup \
    --prefetch-multiplier=1
```

Running all queues in one prefork worker shares the initial application memory
between its child processes while retaining parallel task execution. Celery
determines the concurrency from the number of available CPUs by default; use
`--concurrency` to adjust it for your workload and available memory.

To reduce startup memory usage, Celery workers do not repeat the Django system
checks. The Weblate container runs the more comprehensive
**weblate check --deploy** automatically during container startup. For
other installation methods, run the command after installation, upgrades, or
configuration changes. The checks are also available in the
[management interface](https://docs.weblate.org/ro/latest/admin/admin.md#manage-performance).

#### NOTE
Procesul Celery trebuie să fie executat sub același utilizator ca și procesul WSGI, în caz contrar fișierele din [`DATA_DIR`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-DATA_DIR) vor fi stocate cu proprietate mixtă, ceea ce duce la probleme în timpul execuției.

A se vedea [Permisiunile sistemului de fișiere](#file-permissions) și [Rularea serverului](#server).

### Executing Celery tasks in the WSGI using eager mode

#### NOTE
Acest lucru va avea un impact sever asupra performanțelor interfeței web și va întrerupe caracteristicile care depind de declanșarea regulată (de exemplu, comiterea modificărilor în așteptare, notificările Digest sau copiile de rezervă).

Pentru dezvoltare, este posibil să doriți să utilizați configurația eager, care procesează toate sarcinile pe loc:

```python
CELERY_TASK_ALWAYS_EAGER = True
CELERY_BROKER_URL = "memory://"
CELERY_TASK_EAGER_PROPAGATES = True
```

### Rularea Celery ca serviciu de sistem

Most likely you will want to run Celery as a daemon and that is covered by
[Daemonization](https://docs.celeryq.dev/en/stable/userguide/daemonizing.html). For the most common Linux setup using
systemd, adapt the example files listed below. These examples are maintained in
the Weblate source tree under `weblate/examples/`; Python wheels do not
install these deployment samples.

Unitatea Systemd va fi plasată ca `/etc/systemd/system/celery-weblate.service`:

```ini
[Unit]
Description=Celery Service (Weblate)
After=network.target

[Service]
Type=forking
User=weblate
Group=weblate
EnvironmentFile=/etc/default/celery-weblate
WorkingDirectory=/home/weblate
RuntimeDirectory=celery
RuntimeDirectoryPreserve=restart
LogsDirectory=celery
ExecStart=/bin/sh -c '${CELERY_BIN} multi start ${CELERYD_NODES} \
  -A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
  --logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
ExecStop=/bin/sh -c '${CELERY_BIN} multi stopwait ${CELERYD_NODES} \
  --pidfile=${CELERYD_PID_FILE}'
ExecReload=/bin/sh -c '${CELERY_BIN} multi restart ${CELERYD_NODES} \
  -A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
  --logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'

[Install]
WantedBy=multi-user.target
```

Configurația de mediu care urmează să fie plasată ca `/etc/default/celery-weblate`:

```sh
# Name of nodes to start
CELERYD_NODES="combined"

# Absolute or relative path to the 'celery' command:
CELERY_BIN="/home/weblate/weblate-env/bin/celery"

# App instance to use
# comment out this line if you don't use an app
CELERY_APP="weblate.utils"

# Extra command-line arguments to the worker. Celery determines concurrency
# from the number of available CPUs by default. You might need to customize it
# depending on the available resources and Weblate usage. Increase concurrency
# if you get weblate.E019 error, decrease it on a low-resource system.
# Command-line values override corresponding Celery settings in settings.py.
CELERYD_OPTS="--beat:combined --queues:combined=celery,notify,memory,translate,backup --prefetch-multiplier:combined=1"

# Logging configuration
# - %n will be replaced with the first part of the nodename.
# - %I will be replaced with the current child process index
#   and is important when using the prefork pool to avoid race conditions.
CELERYD_PID_FILE="/run/celery/weblate-%n.pid"
CELERYD_LOG_FILE="/var/log/celery/weblate-%n%I.log"
CELERYD_LOG_LEVEL="INFO"
```

Configurație suplimentară pentru a roti jurnalele Celery folosind **logrotate** pentru a fi plasată ca `/etc/logrotate.d/celery`:

```text
/var/log/celery/*.log {
        weekly
        missingok
        rotate 12
        compress
        notifempty
}
```

### Sarcini periodice folosind Celery beat

Weblate comes with built-in setup for scheduled tasks. The task schedule is
stored in the database and tasks are executed by the Celery beat daemon.

#### HINT
You can define additional tasks in `settings.py`, for example see
[Angajări leneșe](https://docs.weblate.org/ro/latest/admin/continuous.md#lazy-commit).

<a id="monitoring-celery"></a>

### Monitorizarea stării Celery

You can find current length of the Celery task queues in the
[Interfața de gestionare](https://docs.weblate.org/ro/latest/admin/admin.md#management-interface) or you can use [`celery_queues`](https://docs.weblate.org/ro/latest/admin/management.md#weblate-admin-celery_queues) on the
command-line. In case the queue will get too long, you will also get
configuration error in the admin interface.

#### WARNING
În mod implicit, erorile Celery sunt înregistrate doar în jurnalul Celery și nu sunt vizibile pentru utilizator. În cazul în care doriți să aveți o imagine de ansamblu asupra acestor eșecuri, se recomandă să configurați [Collecting error reports and monitoring performance](#collecting-errors).

#### SEE ALSO
* [Monitorizarea Weblate](#monitoring)
* [Cum pot verifica dacă Weblate este configurat corect?](https://docs.weblate.org/ro/latest/faq.md#faq-monitoring)
* [Configuration and defaults](https://docs.celeryq.dev/en/stable/userguide/configuration.html)
* [Workers Guide](https://docs.celeryq.dev/en/stable/userguide/workers.html)
* [Daemonization](https://docs.celeryq.dev/en/stable/userguide/daemonizing.html)
* [Monitoring and Management Guide](https://docs.celeryq.dev/en/stable/userguide/monitoring.html)
* [Background tasks internals](https://docs.weblate.org/ro/latest/contributing/internals.md#background-tasks-internals)
* [`celery_queues`](https://docs.weblate.org/ro/latest/admin/management.md#weblate-admin-celery_queues)

<a id="minimal-celery"></a>

### Single-process Celery setup

In case you have very limited memory, you might want to reduce number of
Weblate processes. All Celery tasks can be executed in a single process using:

```sh
celery --app=weblate.utils worker --beat --queues=celery,notify,memory,translate,backup --pool=solo
```

An installation using Docker can be configured to use a single-process Celery
setup by setting `CELERY_WORKER_MODE=single`. See
[`CELERY_WORKER_MODE`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-CELERY_WORKER_MODE).

#### WARNING
This will have a noticeable performance impact on Weblate.

<a id="monitoring"></a>

## Monitorizarea Weblate

Weblate oferă URL-ul `/healthz/` pentru a fi utilizat în verificări simple ale stării de sănătate, de exemplu, folosind Kubernetes. Containerul Docker are încorporată o verificare a stării de sănătate folosind acest URL.

For monitoring metrics of Weblate you can use the [`GET /api/metrics/`](https://docs.weblate.org/ro/latest/api.md#get--api-metrics-) API
endpoint. Monitoring tools running locally can retrieve the same metrics using
the [`metrics`](https://docs.weblate.org/ro/latest/admin/management.md#weblate-admin-metrics) command.

#### SEE ALSO
* [Cum pot verifica dacă Weblate este configurat corect?](https://docs.weblate.org/ro/latest/faq.md#faq-monitoring)
* [Monitorizarea stării Celery](#monitoring-celery)
* [Weblate plugin for Munin](https://github.com/WeblateOrg/munin)

<a id="collecting-errors"></a>

## Collecting error reports and monitoring performance

Weblate, ca orice alt software, poate da greș. Pentru a colecta stări de eșec utile, vă recomandăm să utilizați servicii terțe pentru a colecta astfel de informații. Acest lucru este util mai ales în cazul sarcinilor Celery care eșuează, care altfel ar raporta erori doar în jurnale și nu veți fi notificat cu privire la acestea. Weblate are suport pentru următoarele servicii:

### Email

The default Weblate configuration instruments Django to send e-mails upon
server errors via [`django.utils.log.AdminEmailHandler`](https://docs.djangoproject.com/en/stable/ref/logging/#django.utils.log.AdminEmailHandler). This
is the least effort setup, but you should consider other options for privacy
reasons, as the error e-mails might include sensitive data. You can read more on
that in [Security implications](https://docs.djangoproject.com/en/stable/topics/logging/#logging-security-implications).

To disable this behavior, remove `mail_admins` from the
[`LOGGING`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-LOGGING) in Weblate settings, or disable
[`WEBLATE_ADMIN_NOTIFY_ERROR`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_ADMIN_NOTIFY_ERROR) in the Docker environment.

### Sentry

Weblate are suport încorporat pentru [Sentry](https://sentry.io/). Pentru a-l utiliza, este suficient să setați [`SENTRY_DSN`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-SENTRY_DSN) în `settings.py`:

```python
SENTRY_DSN = "https://id@your.sentry.example.com/"
```

Sentry can be also used to monitor performance of Weblate by collecting traces
and profiles for defined percentage of operations. This can be configured using
[`SENTRY_TRACES_SAMPLE_RATE`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-SENTRY_TRACES_SAMPLE_RATE) and [`SENTRY_PROFILES_SAMPLE_RATE`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-SENTRY_PROFILES_SAMPLE_RATE).

#### SEE ALSO
* [Sentry Performance Monitoring](https://docs.sentry.io/product/sentry-basics/performance-monitoring/)
* [Sentry Profiling](https://docs.sentry.io/product/profiling/)

### Google Cloud Error Reporting

Weblate can report handled server errors to [Google Cloud Error Reporting](https://docs.cloud.google.com/error-reporting/docs/grouping-errors).
Install Weblate with the `google-errors` extra and configure
[`GOOGLE_CLOUD_ERROR_REPORTING`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-GOOGLE_CLOUD_ERROR_REPORTING) in `settings.py`:

```python
GOOGLE_CLOUD_ERROR_REPORTING = {
    "project": "your-google-cloud-project",
}
```

Weblate automatically reports errors under the `weblate` service and uses the
current Weblate version or Git revision as the reported version. These values
can be overridden by setting `service` or `version` in
[`GOOGLE_CLOUD_ERROR_REPORTING`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-GOOGLE_CLOUD_ERROR_REPORTING).

### OpenTelemetry

Weblate can export backend traces using [OpenTelemetry](https://opentelemetry.io/).
It uses OTLP over HTTP and can send traces to an OpenTelemetry Collector or a
compatible vendor endpoint.

```python
OPENTELEMETRY_ENABLED = True
OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT = "https://collector.example.com/v1/traces"
OPENTELEMETRY_TRACES_SAMPLE_RATE = 0.1
```

The integration traces Django requests, Celery tasks, Redis, outgoing HTTP
requests, database calls, and Weblate-specific spans. Configure it using
[`OPENTELEMETRY_ENABLED`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-OPENTELEMETRY_ENABLED),
[`OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT), and
[`OPENTELEMETRY_TRACES_SAMPLE_RATE`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-OPENTELEMETRY_TRACES_SAMPLE_RATE).

<a id="rollbar-errors"></a>

### Rollbar

Weblate are suport încorporat pentru [Rollbar](https://rollbar.com/). Pentru a-l utiliza, este suficient să urmați instrucțiunile pentru [Rollbar notifier for Python](https://docs.rollbar.com/docs/python/).

Pe scurt, trebuie să ajustați `settings.py`:

```python
# Add rollbar as last middleware:
MIDDLEWARE = [
    # … other middleware classes …
    "rollbar.contrib.django.middleware.RollbarNotifierMiddleware",
]

# Configure client access
ROLLBAR = {
    "access_token": "POST_SERVER_ITEM_ACCESS_TOKEN",
    "environment": "development" if DEBUG else "production",
    "branch": "main",
    "root": "/absolute/path/to/code/root",
}
```

Restul este integrat automat, iar acum veți colecta atât erorile de pe server, cât și cele de pe partea clientului.

#### NOTE
Error logging also includes exceptions that were gracefully handled, but
might indicate a problem - such as failed parsing of an uploaded file.

<a id="graylog"></a>

### Graylog log management

#### Versionadded
Added in version 5.9.

Weblate can be configured to log using the GELF TCP protocol. This was developed
for Graylog integration, but can be used with any compliant logging platform.

The configuration boilerplate is included in [Exemplu de configurare](https://docs.weblate.org/ro/latest/admin/sample.md#sample-configuration), for
Docker this can be configured using [`WEBLATE_LOG_GELF_HOST`](https://docs.weblate.org/ro/latest/admin/install/docker.md#envvar-WEBLATE_LOG_GELF_HOST).

## Migrarea Weblate pe un alt server

Migrarea Weblate pe un alt server ar trebui să fie destul de ușoară, însă acesta stochează date în câteva locații pe care trebuie să le migrați cu atenție. Cea mai bună abordare este să opriți Weblate pentru migrare.

### Migrarea bazei de date

The most straightforward approach is to use database native tools, as they are
usually the most effective (e.g. **pg_dump**). Alternatively you can use
replication if your database supports it.

#### SEE ALSO
Migrating between databases described in [Migrarea de la alte baze de date la PostgreSQL](https://docs.weblate.org/ro/latest/admin/upgrade.md#database-migration).

### Migrarea depozitelor VCS

Depozitele VCS stocate în [`DATA_DIR`](https://docs.weblate.org/ro/latest/admin/config.md#std-setting-DATA_DIR) trebuie, de asemenea, să fie migrate. Puteți să le copiați pur și simplu sau să folosiți **rsync** pentru a face migrarea mai eficient.

### Alte note

Don’t forget to move other services Weblate might have been using like
Valkey, Redis, Cron jobs or custom authentication backends.
