Browse Source

Allow django to load nuxt files

pull/1088/head
Hironsan 4 years ago
parent
commit
4457422090
2 changed files with 5 additions and 9 deletions
  1. 9
      app/app/settings.py
  2. 5
      app/app/urls.py

9
app/app/settings.py

@ -92,7 +92,7 @@ ROOT_URLCONF = 'app.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [path.join(BASE_DIR, 'server/templates'), path.join(BASE_DIR, 'authentification/templates')],
'DIRS': [path.join(BASE_DIR, 'client/dist')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
@ -118,12 +118,7 @@ STATIC_URL = '/static/'
STATIC_ROOT = path.join(BASE_DIR, 'staticfiles')
STATICFILES_DIRS = [
static_path
for static_path in (
path.join(BASE_DIR, 'server', 'static', 'assets'),
path.join(BASE_DIR, 'server', 'static', 'static'),
)
if path.isdir(static_path)
path.join(BASE_DIR, 'client/dist/static'),
]
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

5
app/app/urls.py

@ -15,8 +15,8 @@ Including another URLconf
"""
from django.conf import settings
from django.contrib import admin
from django.urls import path, include
from django.contrib.auth.views import PasswordResetView, LogoutView
from django.urls import path, include, re_path
from django.contrib.auth.views import PasswordResetView, LogoutView, TemplateView
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
@ -43,6 +43,7 @@ urlpatterns = [
path('password_reset/', PasswordResetView.as_view(), name='password_reset'),
path('api-auth/', include('rest_framework.urls')),
path('v1/', include('api.urls')),
re_path('', TemplateView.as_view(template_name='index.html')),
path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
]

Loading…
Cancel
Save