fixed 500 error when reloading admin panel

This commit is contained in:
nvrl committed 2026-02-18 14:32:29 +01:00
1 parent 94b98d7077
commit df88f307f4
2 files changed
+1 -9

No files matched your search

+1 -2
View File
@@ -69,7 +69,7 @@ ROOT_URLCONF = 'holy_backend.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, '..', 'frontend', 'dist')],
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
@@ -142,7 +142,6 @@ USE_TZ = True
STATIC_URL = 'static/'
STATIC_ROOT = BASE_DIR / 'staticfiles'
STATICFILES_DIRS = [os.path.join(BASE_DIR, '..', 'frontend', 'dist')]
STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'
WHITENOISE_INDEX_PAGE = True
-7
View File
@@ -11,9 +11,6 @@ import os
# Clean the admin path
admin_url = os.environ.get('ADMIN_URL', 'admin').strip('/')
# Catch-all view for React
index_view = TemplateView.as_view(template_name="index.html")
urlpatterns = [
# Robots.txt
path('robots.txt', TemplateView.as_view(template_name="robots.txt", content_type="text/plain")),
@@ -27,8 +24,4 @@ urlpatterns = [
path('api/schema/swagger-ui/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'),
path('api/schema/redoc/', SpectacularRedocView.as_view(url_name='schema'), name='redoc'),
path('media/<path:path>', serve, {'document_root': settings.MEDIA_ROOT}),
# Catch-all for React Frontend
path('', index_view, name='index'),
path('<path:resource>', index_view),
]