add: приложение hypn0_site

This commit is contained in:
2026-08-11 16:53:05 +03:00
parent 068a7cb01b
commit dae5610f4b
12 changed files with 63 additions and 3 deletions
+1
View File
@@ -70,6 +70,7 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sitemaps',
'hypn0_site.apps.Hypn0SiteConfig'
]
MIDDLEWARE = [
+4 -3
View File
@@ -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)
View File
+3
View File
@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.
+13
View File
@@ -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'
+3
View File
@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.
+3
View File
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
+14
View File
@@ -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')]
+11
View File
@@ -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', {})
+1
View File
@@ -0,0 +1 @@
<p>Привет</p>
+10
View File
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Временный файл</title>
</head>
<body>
ВРЕМЕННЫЙ ФАЙЛ
</body>
</html>