diff --git a/hypn0/hypn0/settings.py b/hypn0/hypn0/settings.py index 5037ce5..c5bf902 100644 --- a/hypn0/hypn0/settings.py +++ b/hypn0/hypn0/settings.py @@ -70,6 +70,7 @@ INSTALLED_APPS = [ 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sitemaps', + 'hypn0_site.apps.Hypn0SiteConfig' ] MIDDLEWARE = [ diff --git a/hypn0/hypn0/urls.py b/hypn0/hypn0/urls.py index 726bc7f..18f0004 100644 --- a/hypn0/hypn0/urls.py +++ b/hypn0/hypn0/urls.py @@ -17,10 +17,12 @@ Including another URLconf from django.contrib import admin from django.urls import include, path from django.conf.urls.static import static -from hypn0 import settings +from . import settings urlpatterns = [ - path('admin/', admin.site.urls), + # Админ-сайт с переименованными приложениями (переопределен в frontend/apps.py) + path(settings.ADMIN_URL, admin.site.urls), + path('', include('hypn0_site.urls')), ] if settings.DEBUG: @@ -60,7 +62,6 @@ if settings.DEBUG: ] urlpatterns = [path('__debug__/', include(debug_toolbar.urls)), ] + urlpatterns - # urlpatterns = [path('tmp/', views.tmp, name='web_tmp')] + urlpatterns urlpatterns = [*PUBLIC_ROOT_URLPATTERNS, *urlpatterns] urlpatterns += static(settings.STATIC_URL, document_root=settings.PUBLIC_DIR.joinpath('static')) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/hypn0/hypn0_site/__init__.py b/hypn0/hypn0_site/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/hypn0/hypn0_site/admin.py b/hypn0/hypn0_site/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/hypn0/hypn0_site/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/hypn0/hypn0_site/apps.py b/hypn0/hypn0_site/apps.py new file mode 100644 index 0000000..3bdda73 --- /dev/null +++ b/hypn0/hypn0_site/apps.py @@ -0,0 +1,13 @@ +from django.apps import AppConfig + + +class Hypn0SiteConfig(AppConfig): + name = 'hypn0_site' + verbose_name = 'Сайт Hypn0' + + def ready(self) -> None: + """Инициализация Django Admin с кастомным заголовком и названиями.""" + from django.contrib import admin + admin.site.site_header = 'Управление HYPN0' + admin.site.site_title = 'Hypn0 Administrator' + admin.site.index_title = 'Добро пожаловать в Hypn0' diff --git a/hypn0/hypn0_site/migrations/__init__.py b/hypn0/hypn0_site/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/hypn0/hypn0_site/models.py b/hypn0/hypn0_site/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/hypn0/hypn0_site/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/hypn0/hypn0_site/tests.py b/hypn0/hypn0_site/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/hypn0/hypn0_site/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/hypn0/hypn0_site/urls.py b/hypn0/hypn0_site/urls.py new file mode 100644 index 0000000..d46ee74 --- /dev/null +++ b/hypn0/hypn0_site/urls.py @@ -0,0 +1,14 @@ +from django.urls import path + +from . import views +from hypn0 import settings + +app_name = "hypn0_site" + +urlpatterns = [ + path("", views.index, name="index"), +] + + +if settings.DEBUG: + urlpatterns += [path('tmp/', views.tmp, name='web_tmp')] \ No newline at end of file diff --git a/hypn0/hypn0_site/views.py b/hypn0/hypn0_site/views.py new file mode 100644 index 0000000..85aece6 --- /dev/null +++ b/hypn0/hypn0_site/views.py @@ -0,0 +1,11 @@ +from django.shortcuts import render +from django.http import HttpRequest, HttpResponse, Http404 + +# Create your views here. + +def index(request: HttpRequest | None) -> HttpResponse: + return render(request, 'index.html', {}) + + +def tmp(request: HttpRequest | None) -> HttpResponse: + return render(request, 'tmp.html', {}) \ No newline at end of file diff --git a/hypn0/templates/index.html b/hypn0/templates/index.html new file mode 100644 index 0000000..c28961d --- /dev/null +++ b/hypn0/templates/index.html @@ -0,0 +1 @@ +

Привет

diff --git a/hypn0/templates/tmp.html b/hypn0/templates/tmp.html new file mode 100644 index 0000000..83f3a92 --- /dev/null +++ b/hypn0/templates/tmp.html @@ -0,0 +1,10 @@ + + + + + Временный файл + + +ВРЕМЕННЫЙ ФАЙЛ + + \ No newline at end of file