diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | pydis_site/apps/home/urls.py | 5 | ||||
| -rw-r--r-- | pydis_site/settings.py | 5 | ||||
| -rw-r--r-- | pydis_site/templates/base/base.html | 6 | 
4 files changed, 14 insertions, 3 deletions
| @@ -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> | 
