From 716333f57c635c0786de8aeb25969884328cdb72 Mon Sep 17 00:00:00 2001 From: erjemin Date: Fri, 9 Jan 2026 19:54:00 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3?= =?UTF-8?q?=D1=83=D1=80=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=B4=D0=BE=D1=81=D1=82=D1=83=D0=BF=D0=B0=20=D0=BA=20=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D1=82=D0=B8=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etpgrf_site/etpgrf_site/settings.py | 9 ++++++++- etpgrf_site/etpgrf_site/urls.py | 7 ++++++- etpgrf_site/typograph/views.py | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/etpgrf_site/etpgrf_site/settings.py b/etpgrf_site/etpgrf_site/settings.py index 9b3e10e..14e83c0 100644 --- a/etpgrf_site/etpgrf_site/settings.py +++ b/etpgrf_site/etpgrf_site/settings.py @@ -124,10 +124,17 @@ STATIC_URL = 'static/' # Поднимаемся на уровень выше от manage.py, чтобы попасть в корень репозитория # И кладем всё в папку public -STATIC_ROOT = BASE_DIR.parent / 'public' / 'static' +STATIC_ROOT = BASE_DIR.parent / 'public' / 'static_collected' +STATICFILES_DIRS = [BASE_DIR.parent / 'public' / 'static'] MEDIA_ROOT = BASE_DIR.parent / 'public' / 'media' MEDIA_URL = '/media/' +# --- ДИАГНОСТИКА ПУТЕЙ --- +# print(f"DEBUG: {DEBUG}") +# print(f"BASE_DIR: {BASE_DIR}") +# print(f"STATIC_ROOT: {STATIC_ROOT}") +# ------------------------- + # Default primary key field type # https://docs.djangoproject.com/en/6.0/ref/settings/#default-auto-field diff --git a/etpgrf_site/etpgrf_site/urls.py b/etpgrf_site/etpgrf_site/urls.py index 871bda2..ec3fc2c 100644 --- a/etpgrf_site/etpgrf_site/urls.py +++ b/etpgrf_site/etpgrf_site/urls.py @@ -1,7 +1,12 @@ from django.contrib import admin from django.urls import path, include -# from etpgrf_site.etpgrf.typograph import Typographer +from django.conf import settings +from django.conf.urls.static import static + urlpatterns = [ path('admin/', admin.site.urls), path('', include('typograph.urls')), ] + +if settings.DEBUG: + urlpatterns = static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + urlpatterns diff --git a/etpgrf_site/typograph/views.py b/etpgrf_site/typograph/views.py index 8c51647..cee2f3d 100644 --- a/etpgrf_site/typograph/views.py +++ b/etpgrf_site/typograph/views.py @@ -72,7 +72,7 @@ def process_text(request): } # --- ДИАГНОСТИКА --- - print("Typographer options:", options) + # print("Typographer options:", options) # ------------------- # Создаем экземпляр типографа