Add site name config, settings context processor, and site branding to every page

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-07-17 18:17:31 -07:00
parent 4709f5567e
commit 1da0e87c54
3 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
from django.conf import settings as django_settings
def settings(request):
return {"settings": django_settings}

View File

@@ -5,7 +5,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>{% block title %}{% if title %}{{title}}{% else %}Index{% endif %}{% endblock %}</title> <title>{% block title %}- {{settings.SITE_NAME}}{% endblock %}</title>
<link rel="stylesheet" href="{% static 'board/style.css' %}"> <link rel="stylesheet" href="{% static 'board/style.css' %}">
<link rel="stylesheet" href="{% static 'board/font-awesome/css/font-awesome.min.css' %}"> <link rel="stylesheet" href="{% static 'board/font-awesome/css/font-awesome.min.css' %}">
{% block extrastyle %}{% endblock %} {% block extrastyle %}{% endblock %}

View File

@@ -70,6 +70,7 @@ TEMPLATES = [
"django.template.context_processors.request", "django.template.context_processors.request",
"django.contrib.auth.context_processors.auth", "django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages", "django.contrib.messages.context_processors.messages",
"board.context_processors.settings",
], ],
}, },
}, },
@@ -139,6 +140,9 @@ X_FRAME_OPTIONS = "SAMEORIGIN"
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
# Site name
SITE_NAME = "interchan"
# Media root - where media files are stored on the disk # Media root - where media files are stored on the disk
MEDIA_ROOT = "media/" MEDIA_ROOT = "media/"