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:
@@ -1,3 +0,0 @@
|
|||||||
from django.contrib import admin
|
|
||||||
|
|
||||||
# Register your models here.
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
from django.apps import AppConfig
|
|
||||||
|
|
||||||
|
|
||||||
class ListsConfig(AppConfig):
|
|
||||||
name = 'apps.lists'
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.db import models
|
|
||||||
|
|
||||||
# Create your models here.
|
|
||||||
@@ -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>')
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
from django.http import HttpResponse
|
|
||||||
|
|
||||||
def home_page(request):
|
|
||||||
return HttpResponse('<html><title>To-Do Lists</title></html>')
|
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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),
|
||||||
|
|||||||
Reference in New Issue
Block a user