mod: спрятали url админки в .env

This commit is contained in:
2026-01-29 22:51:12 +03:00
parent 7e7d0a7d49
commit 1a7034df66
4 changed files with 10 additions and 3 deletions

View File

@@ -24,6 +24,10 @@ ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS', 'localhost,127.0.0.1').split(',')
# CSRF Trusted Origins (важно для работы через Nginx/Docker)
CSRF_TRUSTED_ORIGINS = os.getenv('CSRF_TRUSTED_ORIGINS', 'http://localhost:8000,http://127.0.0.1:8000').split(',')
# URL админки (можно скрыть через .env)
# По умолчанию 'admin/'
ADMIN_URL = os.getenv('ADMIN_URL', 'admin/')
# Application definition

View File

@@ -12,7 +12,9 @@ sitemaps = {
}
urlpatterns = [
path('adm-in/', admin.site.urls),
# Админка по секретному URL
path(f'{settings.ADMIN_URL}', admin.site.urls),
path('', include('typograph.urls')),
# Блог
@@ -25,6 +27,5 @@ urlpatterns = [
path('<slug:slug>/', blog_views.page_detail, name='page_detail'),
]
# Для отдачи медиафайлов в режиме разработки
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)