diff --git a/djangoTest/urls.py b/djangoTest/urls.py index 9ef3467..0b88e6a 100644 --- a/djangoTest/urls.py +++ b/djangoTest/urls.py @@ -15,8 +15,11 @@ Including another URLconf 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 include, path urlpatterns = [ + # Add the path that our testapp should be served at + path("test/", include("testapp.urls")), + path('admin/', admin.site.urls), ] diff --git a/testapp/__init__.py b/testapp/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/testapp/admin.py b/testapp/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/testapp/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/testapp/apps.py b/testapp/apps.py new file mode 100644 index 0000000..8adcb9d --- /dev/null +++ b/testapp/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class TestappConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'testapp' diff --git a/testapp/migrations/__init__.py b/testapp/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/testapp/models.py b/testapp/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/testapp/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/testapp/tests.py b/testapp/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/testapp/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/testapp/urls.py b/testapp/urls.py new file mode 100644 index 0000000..351caec --- /dev/null +++ b/testapp/urls.py @@ -0,0 +1,6 @@ +from django.urls import path +from . import views + +urlpatterns = [ + path("", views.index_view, name="testapp-index"), +] diff --git a/testapp/views.py b/testapp/views.py new file mode 100644 index 0000000..05ad80e --- /dev/null +++ b/testapp/views.py @@ -0,0 +1,11 @@ +from django.shortcuts import render +from django.http import HttpResponse + +# Create your views here. + + +def index_view(request): + # When this view is requested we will respond with this text + text = "Hello World! This is the testapp." + # Build a Http response with our text and send it to the requester + return HttpResponse(text)