Compare commits

...

3 Commits

11 changed files with 40 additions and 0 deletions

View File

@ -44,6 +44,7 @@ INSTALLED_APPS = [
"django.contrib.messages",
"django.contrib.staticfiles",
"core",
"dashboard",
]
MIDDLEWARE = [
@ -131,6 +132,7 @@ STATIC_ROOT = BASE_DIR / "static"
# User model and authentication
AUTH_USER_MODEL = "accounts.User"
LOGIN_REDIRECT_URL = "dashboard:dashboard"
LOGOUT_REDIRECT_URL = "core:homepage"

View File

@ -22,4 +22,5 @@ urlpatterns = [
path("admin/", admin.site.urls),
path("", include("core.urls", namespace="core")),
path("accounts/", include("accounts.urls")),
path("dashboard/", include("dashboard.urls", namespace="dashboard")),
]

0
dashboard/__init__.py Normal file
View File

3
dashboard/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
dashboard/apps.py Normal file
View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class DashboardConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "dashboard"

View File

3
dashboard/models.py Normal file
View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@ -0,0 +1,5 @@
{% extends 'base.html' %}
{% block content %}
<h1>Dashboard</h1>
{% endblock %}

3
dashboard/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

9
dashboard/urls.py Normal file
View File

@ -0,0 +1,9 @@
from django.urls import path
from .views import Dashboard
app_name = "dashboard"
urlpatterns = [
path("", Dashboard.as_view(), name="dashboard"),
]

8
dashboard/views.py Normal file
View File

@ -0,0 +1,8 @@
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.views.generic import TemplateView
@method_decorator(login_required, name="dispatch")
class Dashboard(TemplateView):
template_name = "dashboard/dashboard.html"