refactored homepage to incl. template structure in root dir; renamed lists app to dashboard & renamed paths in linked py files accordingly (e.g., apps.dashboard.apps, .views; core.settings)

This commit is contained in:
Disco DeDisco
2025-12-30 22:05:33 -05:00
parent f267dd98ae
commit 394d46c718
9 changed files with 4 additions and 26 deletions

View File

View File

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

View File

@@ -1,5 +0,0 @@
from django.apps import AppConfig
class ListsConfig(AppConfig):
name = 'apps.lists'

View File

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

View File

@@ -1,8 +0,0 @@
from django.test import TestCase
class HomePageTest(TestCase):
def test_home_page_returns_correct_html(self):
response = self.client.get('/')
self.assertContains(response, '<title>To-Do Lists</title>')
self.assertContains(response, '<html>')
self.assertContains(response, '</html>')

View File

@@ -1,4 +0,0 @@
from django.http import HttpResponse
def home_page(request):
return HttpResponse('<html><title>To-Do Lists</title></html>')

View File

@@ -39,7 +39,7 @@ INSTALLED_APPS = [
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
# Custom apps # Custom apps
'apps.lists', 'apps.dashboard',
# Depend apps # Depend apps
] ]
@@ -58,7 +58,7 @@ ROOT_URLCONF = 'core.urls'
TEMPLATES = [ TEMPLATES = [
{ {
'BACKEND': 'django.template.backends.django.DjangoTemplates', 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [], 'DIRS': [BASE_DIR / 'templates'],
'APP_DIRS': True, 'APP_DIRS': True,
'OPTIONS': { 'OPTIONS': {
'context_processors': [ 'context_processors': [
@@ -71,6 +71,7 @@ TEMPLATES = [
] ]
WSGI_APPLICATION = 'core.wsgi.application' WSGI_APPLICATION = 'core.wsgi.application'
ASGI_APPLICATION = 'core.asgi.application'
# Database # Database

View File

@@ -1,6 +1,6 @@
from django.contrib import admin from django.contrib import admin
from django.urls import path from django.urls import path
from apps.lists.views import home_page from apps.dashboard.views import home_page
urlpatterns = [ urlpatterns = [
path('admin/', admin.site.urls), path('admin/', admin.site.urls),