From 1bcf7ceba3ee0b912e70dce4ef72b5b24e41d7d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9DNyymix=E2=80=9D?= Date: Sat, 28 Dec 2024 12:21:29 +0200 Subject: [PATCH] Add gallery app --- config/settings.py | 1 + config/urls.py | 3 ++- gallery/__init__.py | 0 gallery/admin.py | 3 +++ gallery/apps.py | 6 ++++++ gallery/migrations/__init__.py | 0 gallery/models.py | 3 +++ gallery/tests.py | 3 +++ gallery/urls.py | 9 +++++++++ gallery/views.py | 9 +++++++++ 10 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 gallery/__init__.py create mode 100644 gallery/admin.py create mode 100644 gallery/apps.py create mode 100644 gallery/migrations/__init__.py create mode 100644 gallery/models.py create mode 100644 gallery/tests.py create mode 100644 gallery/urls.py create mode 100644 gallery/views.py diff --git a/config/settings.py b/config/settings.py index 2921767..624e8b9 100644 --- a/config/settings.py +++ b/config/settings.py @@ -37,6 +37,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'gallery' ] MIDDLEWARE = [ diff --git a/config/urls.py b/config/urls.py index 10a0e72..df178d9 100644 --- a/config/urls.py +++ b/config/urls.py @@ -15,8 +15,9 @@ 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 = [ + path("gallery/", include("gallery.urls")), path('admin/', admin.site.urls), ] diff --git a/gallery/__init__.py b/gallery/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/gallery/admin.py b/gallery/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/gallery/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/gallery/apps.py b/gallery/apps.py new file mode 100644 index 0000000..97a664a --- /dev/null +++ b/gallery/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class GalleryConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'gallery' diff --git a/gallery/migrations/__init__.py b/gallery/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/gallery/models.py b/gallery/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/gallery/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/gallery/tests.py b/gallery/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/gallery/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/gallery/urls.py b/gallery/urls.py new file mode 100644 index 0000000..2336905 --- /dev/null +++ b/gallery/urls.py @@ -0,0 +1,9 @@ +from django.urls import path + +from . import views + +app_name = 'gallery' + +urlpatterns = [ + path("", views.index, name="index"), +] \ No newline at end of file diff --git a/gallery/views.py b/gallery/views.py new file mode 100644 index 0000000..072c89b --- /dev/null +++ b/gallery/views.py @@ -0,0 +1,9 @@ +from django.http import HttpResponse +from django.shortcuts import render + +# Create your views here. + + + +def index(request): + return HttpResponse("Hello, world.") \ No newline at end of file