Compare commits
3 Commits
49c79f3bbe
...
1e2cc408de
Author | SHA1 | Date | |
---|---|---|---|
1e2cc408de | |||
285725ffdd | |||
e373ec5d69 |
0
lists/__init__.py
Normal file
0
lists/__init__.py
Normal file
3
lists/admin.py
Normal file
3
lists/admin.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
6
lists/apps.py
Normal file
6
lists/apps.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class ListsConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'lists'
|
0
lists/migrations/__init__.py
Normal file
0
lists/migrations/__init__.py
Normal file
3
lists/models.py
Normal file
3
lists/models.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
11
lists/tests.py
Normal file
11
lists/tests.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
from django.http import HttpRequest
|
||||||
|
from lists.views import home_page
|
||||||
|
|
||||||
|
# Create your tests here.
|
||||||
|
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>")
|
6
lists/views.py
Normal file
6
lists/views.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
from django.http import HttpResponse
|
||||||
|
|
||||||
|
# Create your views here.
|
||||||
|
def home_page(request):
|
||||||
|
return HttpResponse("<html><title>To-Do lists</title></html>")
|
@ -14,9 +14,9 @@ Including another URLconf
|
|||||||
1. Import the include() function: from django.urls import include, path
|
1. Import the include() function: from django.urls import include, path
|
||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
"""
|
"""
|
||||||
from django.contrib import admin
|
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
from lists.views import home_page
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('admin/', admin.site.urls),
|
path("", home_page, name="home"),
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user