1
Fork 0

Add blog page

This commit is contained in:
Jake Howard 2020-05-07 14:24:50 +01:00
parent 0b2cd9a597
commit 3329090329
Signed by: jake
GPG key ID: 57AFB45680EDD477
7 changed files with 37 additions and 1 deletions

11
templates/blog/index.html Normal file
View file

@ -0,0 +1,11 @@
{% extends "content.html" %}
{% load static %}
{% block title %}Blog{% endblock %}
{% block headerimage %}{% static "img/header.jpg" %}{% endblock %}
{% block content %}
{% endblock%}

0
website/blog/__init__.py Normal file
View file

9
website/blog/tests.py Normal file
View file

@ -0,0 +1,9 @@
from django.urls import reverse
from website.common.tests import BaseTestCase
class BlogListViewTestCase(BaseTestCase):
def test_accessible(self):
response = self.client.get(reverse("blog:list"))
self.assertEqual(response.status_code, 200)

7
website/blog/urls.py Normal file
View file

@ -0,0 +1,7 @@
from django.urls import path
from . import views
app_name = "blog"
urlpatterns = [path("", views.BlogListView.as_view(), name="list")]

5
website/blog/views.py Normal file
View file

@ -0,0 +1,5 @@
from django.views.generic import TemplateView
class BlogListView(TemplateView):
template_name = "blog/index.html"

View file

@ -40,6 +40,7 @@ INSTALLED_APPS = [
"debug_toolbar",
"sri",
"website.common",
"website.blog",
]
MIDDLEWARE = [

View file

@ -4,7 +4,10 @@ from django.urls import include, path
from website.common.urls import urlpatterns as common_urlpatterns
urlpatterns = [path("", include(common_urlpatterns))]
urlpatterns = [
path("", include(common_urlpatterns)),
path("blog/", include("website.blog.urls")),
]
if settings.DEBUG:
urlpatterns.append(path("__debug__/", include(debug_toolbar.urls)))