from django.contrib import admin
from django.urls import path, include, re_path
from django.conf import settings
from django.conf.urls.static import static

from .views import serve_frontend

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/', include('config.api')),
    re_path(r'^(?!static/|media/)(?P<path>.*)$', serve_frontend,  {'document_root': settings.FRONT_DIR}),
    *static(settings.STATIC_URL, document_root=settings.STATIC_ROOT),
    *static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT),
]