mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Use django-statici18n in production
This commit is contained in:
@@ -19,6 +19,7 @@ def contextprocessor(request):
|
||||
ctx = {
|
||||
'url_name': url.url_name,
|
||||
'settings': settings,
|
||||
'DEBUG': settings.DEBUG,
|
||||
}
|
||||
_html_head = []
|
||||
if hasattr(request, 'event'):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{% load compress %}
|
||||
{% load staticfiles %}
|
||||
{% load i18n %}
|
||||
{% load statici18n %}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
@@ -9,7 +10,11 @@
|
||||
{% compress css %}
|
||||
<link rel="stylesheet" type="text/x-scss" href="{% static "pretixcontrol/scss/main.scss" %}" />
|
||||
{% endcompress %}
|
||||
<script type="text/javascript" src="{% url "javascript-catalog" lang=request.LANGUAGE_CODE %}"></script>
|
||||
{% if DEBUG %}
|
||||
<script type="text/javascript" src="{% url 'javascript-catalog' lang=request.LANGUAGE_CODE %}" async></script>
|
||||
{% else %}
|
||||
<script src="{% statici18n LANGUAGE_CODE %}" async></script>
|
||||
{% endif %}
|
||||
{% compress js %}
|
||||
<script type="text/javascript" src="{% static "jquery/js/jquery-2.1.1.min.js" %}"></script>
|
||||
<script type="text/javascript" src="{% static "js/jquery.formset.js" %}"></script>
|
||||
|
||||
@@ -15,7 +15,8 @@ def contextprocessor(request):
|
||||
return {}
|
||||
|
||||
ctx = {
|
||||
'css_file': None
|
||||
'css_file': None,
|
||||
'DEBUG': settings.DEBUG,
|
||||
}
|
||||
_html_head = []
|
||||
_footer = []
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
{% load staticfiles %}
|
||||
{% load i18n %}
|
||||
{% load safelink %}
|
||||
{% load statici18n %}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
@@ -50,7 +51,12 @@
|
||||
{% trans "If this takes longer than a few minutes, please contact us." %}
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript" src="{% url 'javascript-catalog' lang=request.LANGUAGE_CODE %}" async></script>
|
||||
{% if DEBUG %}
|
||||
<script type="text/javascript" src="{% url 'javascript-catalog' lang=request.LANGUAGE_CODE %}" async></script>
|
||||
{% else %}
|
||||
<script src="{% statici18n LANGUAGE_CODE %}" async></script>
|
||||
{% endif %}
|
||||
|
||||
{% compress js %}
|
||||
<script type="text/javascript" src="{% static "jquery/js/jquery-2.1.1.min.js" %}" async></script>
|
||||
<script type="text/javascript" src="{% static "moment/moment-with-locales.js" %}" async></script>
|
||||
|
||||
@@ -180,6 +180,7 @@ INSTALLED_APPS = [
|
||||
'django_otp',
|
||||
'django_otp.plugins.otp_totp',
|
||||
'django_otp.plugins.otp_static',
|
||||
'statici18n',
|
||||
]
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user