diff --git a/hc/front/context_processors.py b/hc/front/context_processors.py new file mode 100644 index 00000000..eca8bd9f --- /dev/null +++ b/hc/front/context_processors.py @@ -0,0 +1,5 @@ +from django.conf import settings + + +def branding(request): + return {"site_name": settings.SITE_NAME, "site_root": settings.SITE_ROOT} diff --git a/hc/settings.py b/hc/settings.py index 7662ea3a..c3d9669b 100644 --- a/hc/settings.py +++ b/hc/settings.py @@ -87,6 +87,7 @@ TEMPLATES = [ "django.template.context_processors.request", "django.contrib.auth.context_processors.auth", "django.contrib.messages.context_processors.messages", + "hc.front.context_processors.branding", "hc.payments.context_processors.payments", ] }, @@ -141,13 +142,10 @@ if os.getenv("DB") == "mysql": } } -TIME_ZONE = "UTC" - -USE_I18N = False - -USE_L10N = False - USE_TZ = True +TIME_ZONE = "UTC" +USE_I18N = True +USE_L10N = True SITE_ROOT = os.getenv("SITE_ROOT", "http://localhost:8000") SITE_NAME = os.getenv("SITE_NAME", "Mychecks") diff --git a/templates/accounts/billing.html b/templates/accounts/billing.html index 51b6800c..570dcd17 100644 --- a/templates/accounts/billing.html +++ b/templates/accounts/billing.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load compress static hc_extras %} -{% block title %}Account Settings - {% site_name %}{% endblock %} +{% block title %}Account Settings - {{ site_name }}{% endblock %} {% block content %}
You are about to log into {% site_name %}.
+You are about to log into {{ site_name }}.
Please press the button below to continue:
The login link you just used is either incorrect or expired.
diff --git a/templates/accounts/notifications.html b/templates/accounts/notifications.html index 83346f0f..e05b0f43 100644 --- a/templates/accounts/notifications.html +++ b/templates/accounts/notifications.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load hc_extras %} -{% block title %}Account Settings - {% site_name %}{% endblock %} +{% block title %}Account Settings - {{ site_name }}{% endblock %} {% block content %}- Attach a password to your {% site_name %} account + Attach a password to your {{ site_name }} account
- Please pick a password for your {% site_name %} account. + Please pick a password for your {{ site_name }} account.
Your email address has been unsubscribed from - {% site_name %} reports. + {{ site_name }} reports.
{% endblock %} diff --git a/templates/base.html b/templates/base.html index 495e0abd..4593fa62 100644 --- a/templates/base.html +++ b/templates/base.html @@ -2,7 +2,7 @@ -- {% site_name %} provides status badges for each of the tags - you have used. Additionally, the "{% site_name %}" + {{ site_name }} provides status badges for each of the tags + you have used. Additionally, the "{{ site_name }}" badge shows the overall status of all checks in a project. The badges have public, but hard-to-guess URLs. You can use them in your READMEs, diff --git a/templates/front/base_docs.html b/templates/front/base_docs.html index 349009ba..72391949 100644 --- a/templates/front/base_docs.html +++ b/templates/front/base_docs.html @@ -7,7 +7,7 @@
The project "{{ project }}" does not have any integrations set up yet.
-With no configured integrations, {% site_name %} +
With no configured integrations, {{ site_name }} will not send any notifications when checks change state.
diff --git a/templates/front/docs_cron.html b/templates/front/docs_cron.html index 43927a14..843d66b9 100644 --- a/templates/front/docs_cron.html +++ b/templates/front/docs_cron.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load hc_extras %} -{% block title %}Cron Syntax Cheatsheet - {% site_name %}{% endblock %} +{% block title %}Cron Syntax Cheatsheet - {{ site_name }}{% endblock %} {% block description %} @@ -16,7 +16,7 @@- {% site_name %} understands most of the traditional cron syntax features. + {{ site_name }} understands most of the traditional cron syntax features. Under the hood, it uses the croniter package to parse and interpret cron expressions. Below is a showcase of @@ -462,7 +462,7 @@ Cron daemon uses server's local time. If your server's timezone is other than UTC, make sure to set a matching timezone for your check - on {% site_name %} as well. + on {{ site_name }} as well.
On Ubuntu systems you can check the server's timezone diff --git a/templates/front/docs_single.html b/templates/front/docs_single.html index 2bd71ca5..6080603c 100644 --- a/templates/front/docs_single.html +++ b/templates/front/docs_single.html @@ -1,7 +1,7 @@ {% extends "front/base_docs.html" %} {% load compress static hc_extras %} -{% block title %}{{ first_line|striptags }} - {% site_name %}{% endblock %} +{% block title %}{{ first_line|striptags }} - {{ site_name }}{% endblock %} {% block description %}{% endblock %} {% block keywords %}{% endblock %} diff --git a/templates/front/filtering_rules_modal.html b/templates/front/filtering_rules_modal.html index e3711232..6b51b5c9 100644 --- a/templates/front/filtering_rules_modal.html +++ b/templates/front/filtering_rules_modal.html @@ -29,7 +29,7 @@ Only POST - If set, {% site_name %} will ignore HTTP requests + If set, {{ site_name }} will ignore HTTP requests using any other request method. diff --git a/templates/front/log.html b/templates/front/log.html index aa0e93ef..dc90b3e3 100644 --- a/templates/front/log.html +++ b/templates/front/log.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load compress humanize static hc_extras %} -{% block title %}My Checks - {% site_name %}{% endblock %} +{% block title %}Ping Log - {{ site_name }}{% endblock %} {% block content %} diff --git a/templates/front/projects.html b/templates/front/projects.html index a820968d..f2ec0416 100644 --- a/templates/front/projects.html +++ b/templates/front/projects.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load compress static hc_extras %} -{% block title %}{% site_name %}{% endblock %} +{% block title %}{{ site_name }}{% endblock %} {% block content %} diff --git a/templates/front/unsubscribe_success.html b/templates/front/unsubscribe_success.html index 175dffb3..a370d7fe 100644 --- a/templates/front/unsubscribe_success.html +++ b/templates/front/unsubscribe_success.html @@ -7,6 +7,6 @@
Your email address has been unsubscribed from - {% site_name %} notifications. + {{ site_name }} notifications.
{% endblock %} diff --git a/templates/front/verify_email_success.html b/templates/front/verify_email_success.html index e566a0e2..bda8e0d1 100644 --- a/templates/front/verify_email_success.html +++ b/templates/front/verify_email_success.html @@ -10,7 +10,7 @@Success! You've verified this email address, and it will now receive - {% site_name %} notifications. + {{ site_name }} notifications.
{{ ping_url }}
@@ -123,7 +123,7 @@
sending email messages.
- You can instruct {% site_name %} to look for a particular + You can instruct {{ site_name }} to look for a particular keyword in the subject line. This is handy when your backup software sends an email after every run, and uses a different subject line depending on success or failure. @@ -140,7 +140,7 @@
- {% site_name %} provides status badges for each of the tags - you have used. Additionally, the "{% site_name %}" badge + {{ site_name }} provides status badges for each of the tags + you have used. Additionally, the "{{ site_name }}" badge shows the overall status of all checks in your account.
@@ -511,11 +511,11 @@
{% site_name %} monitoring is a great fit for cron jobs and cron-like systems +
{{ site_name }} monitoring is a great fit for cron jobs and cron-like systems (systemd timers, Jenkins build jobs, Windows Scheduled Tasks, wp-cron, uwsgi cron-like interface, Heroku Scheduler, ...). A failed cron job often has no immediate visible consequences, and can go unnoticed for a long time.
@@ -534,9 +534,9 @@{% site_name %} monitoring can be used for lightweight server monitoring: +
{{ site_name }} monitoring can be used for lightweight server monitoring: ensuring a particular system service, or the server as a whole is alive and healthy. - Write a shell script that checks for a specific condition, and pings {% site_name %} + Write a shell script that checks for a specific condition, and pings {{ site_name }} if successful. Run the shell script regularly.
Specific examples:
@@ -557,7 +557,7 @@