netbox/netbox/templates/exceptions/import_error.html
Jason Novinger 9e13d89baa Fixes #20766: Prevent translation of code/commands in error templates
Use blocktrans 'with' clause to pass literal code/commands as variables,
preventing them from being translated. This fixes issues where commands
like 'manage.py collectstatic' were incorrectly translated to nonsensical
strings in non-English locales.

Updated templates:
- media_failure.html: manage.py collectstatic
- programming_error.html: python3 manage.py migrate, SELECT VERSION()
- import_error.html: requirements.txt, local_requirements.txt, pip freeze
2025-11-14 16:24:17 -06:00

27 lines
1.2 KiB
HTML

{% extends '500.html' %}
{% load i18n %}
{% block message %}
<p>
{% trans "A module import error occurred during this request. Common causes include the following:" %}
</p>
<p>
<i class="mdi mdi-alert"></i>
<strong>{% trans "Missing required packages" %}.</strong>
{% blocktrans trimmed with req_file="requirements.txt" local_req_file="local_requirements.txt" pip_cmd="pip freeze" %}
This installation of NetBox might be missing one or more required Python packages. These packages are listed in
<code>{{ req_file }}</code> and <code>{{ local_req_file }}</code>, and are normally installed as part of the
installation or upgrade process. To verify installed packages, run <code>{{ pip_cmd }}</code> from the console and
compare the output to the list of required packages.
{% endblocktrans %}
</p>
<p>
<i class="mdi mdi-alert"></i>
<strong>{% trans "WSGI service not restarted after upgrade" %}.</strong>
{% blocktrans trimmed %}
If this installation has recently been upgraded, check that the WSGI service (e.g. gunicorn or uWSGI) has been
restarted. This ensures that the new code is running.
{% endblocktrans %}
</p>
{% endblock message %}