Skip to content
Snippets Groups Projects
Commit 2044b344 authored by Bastien Abadie's avatar Bastien Abadie
Browse files

Merge branch 'dev-static' into 'master'

Serve static files from the backend in dev

See merge request !645
parents 4abcf7a0 97f1c2d5
No related branches found
No related tags found
1 merge request!645Serve static files from the backend in dev
......@@ -28,9 +28,9 @@ RUN \
COPY dist/arkindex-*.tar.gz /tmp/arkindex.tar.gz
RUN pip install /tmp/arkindex.tar.gz && rm /tmp/arkindex.tar.gz
# Allow access to logs
RUN mkdir -p /logs
RUN chown -R ark:teklia /logs
# Allow access to static files directory
RUN mkdir -p /backend_static
RUN chown -R ark:teklia /backend_static
# Copy Version file
COPY VERSION /etc/arkindex.version
......
from django.urls import path, include, re_path
from django.conf import settings
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from arkindex.project.api_v1 import api
from arkindex.project.views import FrontendView, CdnHome
......@@ -18,6 +19,10 @@ if 'debug_toolbar' in settings.INSTALLED_APPS:
path('__debug__/', include(debug_toolbar.urls)),
] + urlpatterns
if settings.DEBUG:
# Serve static files in development—this is done by manage.py runserver, but not by Daphne in dev
urlpatterns.extend(staticfiles_urlpatterns())
# Add index.html using CDN assets
# It's served as a full fallback on 404 to support loading specific frontend urls
if settings.CDN_ASSETS_URL is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment