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) # ------------------- # Создаем экземпляр типографа