Add tophat_ui, which currently gives us a simple root page and no more.

status-serialisers
Marnanel Thurman 2020-08-23 17:32:42 +01:00
rodzic 4d7d0c7754
commit 68a1c3c8ac
6 zmienionych plików z 68 dodań i 1 usunięć

Wyświetl plik

@ -94,6 +94,7 @@ INSTALLED_APPS = (
'kepi.bowler_pub',
'kepi.sombrero_sendpub',
'kepi.trilby_api',
'kepi.tophat_ui',
)

Wyświetl plik

@ -6,6 +6,7 @@ import oauth2_provider.views as oauth2_views
import kepi.busby_1st.urls
import kepi.bowler_pub.urls
import kepi.trilby_api.urls
import kepi.tophat_ui.urls
from kepi.trilby_api.views import fix_oauth2_redirects
from . import settings
@ -31,7 +32,7 @@ urlpatterns = [
path('oauth/', include((oauth2_endpoint_views, 'oauth2_provider'), namespace="oauth2_provider")),
# kepi's own stuff
# path('', kepi.tophat_ui.views.FrontPageView.as_view()), # or something
path(r'', include(kepi.tophat_ui.urls)),
path(r'', include(kepi.busby_1st.urls)),
path(r'', include(kepi.bowler_pub.urls)),
path(r'', include(kepi.trilby_api.urls)),

Wyświetl plik

Wyświetl plik

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<title>Kepi is installed</title>
</head>
<body>
<p>
If you can see this message,
Kepi is installed correctly.
</p>
<p>
I appreciate that this message is not particularly
interesting or helpful. This will change in
later releases.
</p>
<p>
You might like to visit <a href="admin/">the admin console</a>
now, to set things up.
</p>
<p>
Love and hugs.
</p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,13 @@
# tophat_ui/urls.py
#
# Part of kepi.
# Copyright (c) 2018-2020 Marnanel Thurman.
# Licensed under the GNU Public License v2.
from django.urls import path, re_path
import kepi.tophat_ui.views as tophat_views
urlpatterns = [
path('', tophat_views.RootPageView.as_view()),
]

Wyświetl plik

@ -0,0 +1,25 @@
# views.py
#
# Part of kepi.
# Copyright (c) 2018-2020 Marnanel Thurman.
# Licensed under the GNU Public License v2.
import logging
logger = logging.getLogger(name='kepi')
from django.views import View
from django.shortcuts import render
class RootPageView(View):
def get(self, request, *args, **kwargs):
logger.info("Serving root page")
result = render(
request=request,
template_name='root-page.html',
content_type='text/html',
)
return result