Compare commits
4 Commits
9a8d9f9c60
...
e52ef3e5eb
| Author | SHA1 | Date |
|---|---|---|
|
|
e52ef3e5eb | |
|
|
b07b223729 | |
|
|
447edf45cb | |
|
|
6e7b02a2e1 |
|
|
@ -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"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class DashboardConfig(AppConfig):
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "dashboard"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Dashboard</h1>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
from django.urls import path
|
||||
|
||||
from .views import Dashboard
|
||||
|
||||
app_name = "dashboard"
|
||||
|
||||
urlpatterns = [
|
||||
path("", Dashboard.as_view(), name="dashboard"),
|
||||
]
|
||||
|
|
@ -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"
|
||||
Loading…
Reference in New Issue