From 64576a7f09b15243e4494b776455b05f322cf60c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9DNyymix=E2=80=9D?= Date: Sat, 9 Aug 2025 18:25:13 +0300 Subject: [PATCH] Start main app --- config/settings.py | 1 + config/urls.py | 3 ++- main/__init__.py | 0 main/admin.py | 3 +++ main/apps.py | 6 ++++++ main/migrations/__init__.py | 0 main/models.py | 3 +++ main/tests.py | 3 +++ main/urls.py | 7 +++++++ main/views.py | 6 ++++++ 10 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 main/__init__.py create mode 100644 main/admin.py create mode 100644 main/apps.py create mode 100644 main/migrations/__init__.py create mode 100644 main/models.py create mode 100644 main/tests.py create mode 100644 main/urls.py create mode 100644 main/views.py diff --git a/config/settings.py b/config/settings.py index 082bf92..ea8f284 100644 --- a/config/settings.py +++ b/config/settings.py @@ -37,6 +37,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'main' ] MIDDLEWARE = [ diff --git a/config/urls.py b/config/urls.py index 35a0802..e1b9a84 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("", include("main.urls")), path('admin/', admin.site.urls), ] diff --git a/main/__init__.py b/main/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/main/admin.py b/main/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/main/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/main/apps.py b/main/apps.py new file mode 100644 index 0000000..167f044 --- /dev/null +++ b/main/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class MainConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'main' diff --git a/main/migrations/__init__.py b/main/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/main/models.py b/main/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/main/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/main/tests.py b/main/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/main/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/main/urls.py b/main/urls.py new file mode 100644 index 0000000..5119061 --- /dev/null +++ b/main/urls.py @@ -0,0 +1,7 @@ +from django.urls import path + +from . import views + +urlpatterns = [ + path("", views.index, name="index"), +] diff --git a/main/views.py b/main/views.py new file mode 100644 index 0000000..2848eff --- /dev/null +++ b/main/views.py @@ -0,0 +1,6 @@ +from django.http import HttpResponse +from django.shortcuts import render + + +def index(request): + return HttpResponse("Hello, world.")