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:
5
board/context_processors.py
Normal file
5
board/context_processors.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from django.conf import settings as django_settings
|
||||
|
||||
|
||||
def settings(request):
|
||||
return {"settings": django_settings}
|
||||
@@ -5,7 +5,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<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/font-awesome/css/font-awesome.min.css' %}">
|
||||
{% block extrastyle %}{% endblock %}
|
||||
|
||||
@@ -70,6 +70,7 @@ TEMPLATES = [
|
||||
"django.template.context_processors.request",
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
"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"
|
||||
|
||||
# Site name
|
||||
SITE_NAME = "interchan"
|
||||
|
||||
# Media root - where media files are stored on the disk
|
||||
MEDIA_ROOT = "media/"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user