diff --git a/castellum_core/castellum_core/castellum_core/urls.py b/castellum_core/castellum_core/castellum_core/urls.py index dfc94b35082321507e1e6a38954fa5e5da8d3d69..bd84346b1d3973eddb1e57fbd420455facef7023 100644 --- a/castellum_core/castellum_core/castellum_core/urls.py +++ b/castellum_core/castellum_core/castellum_core/urls.py @@ -1,9 +1,11 @@ from django.contrib import admin from django.urls import path from django.contrib.auth import views as auth_views +from django.views.generic import TemplateView urlpatterns = [ + path('', TemplateView.as_view(template_name='index.html'), name='index'), path('login/', auth_views.LoginView.as_view(template_name="login.html"), name='login'), path('logout/', auth_views.LogoutView.as_view(), name='logout'), diff --git a/castellum_core/castellum_core/templates/index.html b/castellum_core/castellum_core/templates/index.html new file mode 100644 index 0000000000000000000000000000000000000000..27ed1d3108755017931087ab2828b8853a27cedd --- /dev/null +++ b/castellum_core/castellum_core/templates/index.html @@ -0,0 +1,21 @@ +{% extends "base.html" %} +{% load i18n bootstrap4 %} + +{% block title %}{% trans "Start" %} · {{ block.super }}{% endblock %} + +{% block content %} + {% if request.user.is_authenticated %} +
+ {% if request.user.is_superuser %} +
You are logged in as admin
+ {% else %} +
You are not listed as admin
+ {% endif %} +
You are registered since {{ request.user.date_joined|timesince}}
+
+ {% else %} +
+ Not logged in +
+ {% endif %} +{% endblock %}