aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2019-04-14 14:44:15 +0100
committerGravatar Gareth Coles <[email protected]>2019-04-14 14:44:15 +0100
commitadafc9e405434b6b5ce47eff5be0e8be9e9688b6 (patch)
treeef20dee66b0b6b1b881f86853d8636cad257e1f9
parentSome work towards fixed navigation (diff)
Fixing up image plugin
-rw-r--r--.gitignore1
-rw-r--r--pydis_site/apps/home/urls.py5
-rw-r--r--pydis_site/settings.py5
-rw-r--r--pydis_site/templates/base/base.html6
4 files changed, 14 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index f4306438..2888775d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -113,6 +113,7 @@ rethinkdb_data/
# Node modules
node_modules/
+media/
pip-wheel-metadata/
staticfiles/
diff --git a/pydis_site/apps/home/urls.py b/pydis_site/apps/home/urls.py
index dacf0a3a..34ceda40 100644
--- a/pydis_site/apps/home/urls.py
+++ b/pydis_site/apps/home/urls.py
@@ -1,3 +1,5 @@
+from django.conf import settings
+from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from django.views.generic import TemplateView
@@ -6,6 +8,7 @@ from django.views.generic import TemplateView
app_name = 'home'
urlpatterns = [
path('admin/', admin.site.urls),
+ path('notifications/', include('django_nyt.urls')),
path('wiki/', include('wiki.urls')),
path('', TemplateView.as_view(template_name='home/index.html'), name='home.index'),
-]
+] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
diff --git a/pydis_site/settings.py b/pydis_site/settings.py
index 6c9af3aa..46d49f44 100644
--- a/pydis_site/settings.py
+++ b/pydis_site/settings.py
@@ -120,7 +120,9 @@ TEMPLATES = [
'context_processors': [
'django.template.context_processors.debug',
+ 'django.template.context_processors.media',
'django.template.context_processors.request',
+ 'django.template.context_processors.static',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
@@ -181,6 +183,9 @@ STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'pydis_site', 'static')]
STATIC_ROOT = env('STATIC_ROOT', default='staticfiles')
+MEDIA_URL = '/media/'
+MEDIA_ROOT = env('MEDIA_ROOT', default='media')
+
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
diff --git a/pydis_site/templates/base/base.html b/pydis_site/templates/base/base.html
index 5b124ded..7164ce47 100644
--- a/pydis_site/templates/base/base.html
+++ b/pydis_site/templates/base/base.html
@@ -1,6 +1,5 @@
{# Base template, with a few basic style definitions. #}
-{% load django_simple_bulma %}
-{% load static %}
+{% load django_simple_bulma sekizai_tags static %}
<!DOCTYPE html>
<html lang="en">
@@ -22,6 +21,8 @@
>
{% block head %}{% endblock %}
+
+ {% render_block "css" %}
</head>
<body>
@@ -29,5 +30,6 @@
{{ block.super }}
{% endblock %}
+{% render_block "js" %}
</body>
</html>